Suppose my array is [\"abcdefg\", \"hijklmnop\"] and I am looking at if \"mnop\" is part of this array. How can I do this using a javascript method?
I tried this and it
Javascript does not provide what you're asking before because it's easily done with existing functions. You should iterate through each array element individually and call indexOf on each element:
indexOf
array.forEach(function(str){ if(str.indexOf("mnop") !== -1) return str.indexOf("mnop"); });