Regular Expressions: Extract Matches
let extractStr = "Extract the word 'coding' from this string.";
let codingRegex = /coding/; // Change this line
let result = extractStr.match('coding'); // Change this line
Should it not be .match(codingRegex)? It still passes the tests even in this method
it works because
If [the argument] is a non-
RegExp object, it is implicitly converted to a
RegExp by using
new RegExp(regexp) .
also none of the tests specifically check the argument of
Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.