contains value in array typescript code example
Example 1: typescript check if element in array
your_array.includes(the_element)
Example 2: javascript includes method getting 'hi' and 'high' problem
var str = 'hilly';
var value = str.includes('hi'); //true, even though the word 'hi' isn't found
var value = /\bhi\b/.test(str); //false - 'hi' appears but not as its own word