Horje
check if array does not contain string js Code Example
check if array does not contain value javascript
var fruits = ["Banana", "Orange", "Apple", "Mango"];

var n = fruits.includes("Mango"); // true

var n = fruits.includes("Django"); // false
check if array does not contain string js
function checkInput(input, words) {
 return words.some(word => input.toLowerCase().includes(word.toLowerCase()));
}

console.log(checkInput('"Definitely," he said in a matter-of-fact tone.', 
["matter", "definitely"]));
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"]));




Javascript

Related
react hook form password validation uppercase Code Example react hook form password validation uppercase Code Example
$.post javascript Code Example $.post javascript Code Example
how to concatenate a string in javascript Code Example how to concatenate a string in javascript Code Example
updating json object in mysql database Code Example updating json object in mysql database Code Example
qr code terminal npm Code Example qr code terminal npm Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9