It is supposed to remove all duplicates in the string, but please fill in my knowledge of this as I’m not quite sure I understand…
function removeDupes(input){
return input.replace(/[^\w\s]/gi, ``)
}
I know //
starts regex, []
are for any of these characters, ^
is for the start of the string, \w
is word, and \s
is white space? I know /gi
is global insensitive, and the empty string is to replace all of those instances with a blank. I guess what I’m having trouble with is understanding fully as to why, or mostly [^\w\s]
EDIT: Just tried in the console and it doesn’t even work, haha