What is the purpose of [\w]?

What is the purpose of [\w]?
0.0 0

#1

Tell us what’s happening:

guyz… what is [\W] means?

Your code so far

function palindrome(str) {
  // Good luck!
 return str.replace(/[\W_]/g, '').toLowerCase() === str.replace(/[\W_]/g, '').toLowerCase().split('').reverse().join('');

  
}



palindrome("eye");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0.

Link to the challenge:


Why is the purpose of putting an underscore
#2

https://www.w3schools.com/jsref/jsref_regexp_wordchar_non.asp


#3

Tell us what’s happening:

why is the purpose of putting an underscore in expression [\W_]?

Your code so far

function palindrome(str) {
  // Good luck!
 return str.replace(/[\W_]/g, '').toLowerCase() === str.replace(/[\W_]/g, '').toLowerCase().split('').reverse().join('');

  
}



palindrome("eye");

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0.

Link to the challenge: