I have a Javascript array var array = ["1-2", "3-6", "4", "1-6", "4"] and want to remove all elements that contain the variable var m = "6", i.e. "3-6" and "1-6".
I found this line of code var newarray = array.filter(a => a !== "4"), which creates a new array that does not contain the two "4" elements. But I have not found out how to use regular expressions in order to remove all elements that CONTAIN the given variable m = "6".
I thought about something like var newarray = array.filter(a => a !== /eval("return m")/), but this does not work.
I very appreciate your help and apologize for my English :)