As an argument to made dependent on the variable?
In this case, to do so you can set the value through a variable?
var words = ["snow", "red"]
var input = "red";
var result = words.toString().match("/" + input + "/gi");
asked July 2nd 19 at 17:37
If the task is to find the word in the array, then for this example has a method indexOf.