Answers for "array contains case insensitive javascript"

1

array contains case insensitive javascript

var array = ['I', 'hAve', 'theSe', 'ITEMs'],
    query = 'these',
    result = array.findIndex(item => query.toLowerCase() === item.toLowerCase());

console.log(result); // 2
Posted by: Guest on April-01-2020
0

array contains case insensitive javascript

arr.some(x => x.toLowerCase() == lookup.toLowerCase())
Posted by: Guest on July-27-2021

Code answers related to "array contains case insensitive javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language