0

Can anyone explain what the second g represent in this

let str= “good” Alert(str.match(/g/g).lenght)

24th Oct 2018, 4:06 AM
Lailuma Norani
Lailuma Norani - avatar
1 Answer
+ 1
just found the answer g modifier is used to perform search globaly if we dun use “g “it will return only the first match
24th Oct 2018, 4:15 AM
Lailuma Norani
Lailuma Norani - avatar