match: it takes a substring or regular expression pattern as an argument and it returns an array if there is match if not it returns null. Let us see how a regular expression pattern looks like. It starts with / sign and ends with / sign.

PHOTO EMBED

Fri Sep 16 2022 09:20:49 GMT+0000 (Coordinated Universal Time)

Saved by @sreejithbs

let string = 'I love JavaScript. If you do not love JavaScript what else can you love.'
console.log(string.match('love'))
content_copyCOPY

https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/02_Day_Data_types/02_day_data_types.md