let quoteSample = “The five boxing wizards jump quickly.”;

let alphabetRegexV2 = /\w/ig;(here global flag is used and it is doing )

let result = quoteSample.match(alphabetRegexV2).length;

             can any  one explain what does the global flag do .   in any code do

what the global flag does depends on method: with match() if you don’t use global flag it will return just first match, if you use global flag it will return all matches

don’t use global flag with other methods before checking documentation on that method