Answers for "check if an array contains a type"

9

typescript check if element in array

your_array.includes(the_element)
Posted by: Guest on March-25-2020
0

check if array does not contain string js

function checkInput(input, words) {
 return words.some(word => new RegExp(word, "i").test(input));
}

console.log(checkInput('"Definitely," he said in a matter-of-fact tone.', 
["matter", "definitely"]));
Posted by: Guest on June-07-2020

Code answers related to "check if an array contains a type"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language