Tell us what’s happening:
I thought I can pass the test without using the ? symbol and I was right. Even in the example if the passed in pattern was /ti/ it would return the same thing.
So what exactly is the function of the ? symbol and can someone give me a better example wherein I’d HAVE to use the ? symbol.
Your code so far
let text = "<h1>Winter is coming</h1>"; let myRegex = /<h1>/; // Change this line let result = text.match(myRegex);
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.