0 points

RegEx - The .match method's first parameter can instead be a regular expression.


dashboard

Tue Aug 04 2020 19:20:14 GMT+0000 (UTC)

Posted by @ludaley #javascript

myName = 'yazeed';

myName.match(/e/);
// ["e", index: 3, input: "yazeed", groups: undefined]
content_copy Copy

Regular Expressions (Regex) The .match method's first parameter can instead be a regular expression. Regular Expression - A sequence of characters that define a search pattern. Also known as "Regex". Instead of quotation marks for a string, put your parameter between forward slashes.

https://www.freecodecamp.org/news/freecodecamp-palindrome-checker-walkthrough/