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
a possible solution is filtering the array through string.match
string.match
var array= ["abcdefg", "hijklmnop"]; var res = array.filter(x => x.match(/mnop/)); console.log(res)