Using Meta Characters in JavaScript
Good day bosses .. I am having a terrible time with this little code.. I am trying to use Regular Expression - Meta Characters to find "Le Guin" in the "wannabe" Array without having to type "Le Guin" directly in the Conditional statement, but through using some Meta-Characters.... Funny enough I tried this yesterday and it worked but I don't know what's wrong with it now... The "!/[Le *Guin]/" in the for Conditional statement is what am talking about... Please what could be wrong with the code <script> wannabe = ["Le Guin", "Ibrahim", "Ope", "You", "Le Guin", "Now", "Then", "Who", "Le Guin"]; for (a = 0; a < wannabe.length; ++a) { if (wannabe[a] == !/[Le*Guin]/) { document.write(a + ": " + "This is found at: " + a + "<br>") break } else { document.write(a + ": " + "not yet" + "<br>") } } </script>