Many times I’m using the string match
function to know if a string matches a regular expression.
if(str.match(/{regex}/))
Is there any difference between this:
if (/{regex}/.test(str))
They seem to give the same result?
Many times I’m using the string match
function to know if a string matches a regular expression.
if(str.match(/{regex}/))
Is there any difference between this:
if (/{regex}/.test(str))
They seem to give the same result?