I need to search an array in javascriptJavaScript. The search would be for only part of the string to match as the string would have addtional numbers assigned to itadditional components. I would then need to return the successfully matched array element with the full string.
i.e.Example:
var windowArray = new Array ("item","thing","id-3-text","class");
const windowArray = [ "item", "thing", "id-3-text", "class" ];
I need to search for the array element with "id-"
in it and iI need to pull the rest of the text in the element as well (iei.e. "id-3-text"
).
ThanksHow do I do that?