Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #case #insensitive #javascript
ADD COMMENT
Topic
Name
1+1 =