TypeScript simplest way to check if item exists in array like C# Linq Any ( using any library ) -


typescript simplest way check if item exists in array c# linq ( using library ).

var myarray=[1,2,3,4];    var is_3_exist=myarray.any(x=> x==3);

use .some:

myarray.some(x=>x==3);


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

Python Error - TypeError: input expected at most 1 arguments, got 3 -

dns - How To Use Custom Nameserver On Free Cloudflare? -