Searching for a way to identify matching strings and substrings in an array. For example:
Given a string "3-100" and an array of strings ["3", "3-1", "3-15", "3-",3-10", "3-100"].
When looping through the array, the expected outcomes should be:
"3" -> true,
"3-1" -> false,
"3-15" -> false,
"3-" -> false,
"3-10" -> false,
"3-100" -> true,
What methods can be used achieve this? Previously attempted .includes() which did not work for all cases. Seeking advice.
Best regards, Adjo