Can you write me a Javascript function to check if a string of varying formats is a palindrome? Do not use a for loop and try to use built in functions instead of writing your own.
system
kya aap mujhe yah jaanchane ke liye ek javascript fnction likh sakate hai ki kya alag -alag swaroopon kii ek string ek palyndrome he?loop ke liye ek kaa upyog na karen or apane swayan ke likhane ke bajaay kaaryon main nirmit upyog karne kaa prayaas karen.
user
yahaan ek javascript fnction banane kii ek vidhi he jo jaanch karegi ki kya ek string ek palyndrome he.fnction input string ke rikt sthaan, viraam chihn or puunjikaran ko andekha karata he.

fnction palindrome (str) {
  var regex = /[\ w] /g;
  modstr = str.tolowerCase (). pratisthapit (regex, '');
  reversedstr = modstr.split (''). reverse (). JOIN ('');
  ritern modstr === ulta;
}
assistant
<|system|>
</s>
<|user|>
kya aap mujhe yah jaanchane ke liye ek javascript fnction likh sakate hai ki kya alag -alag swaroopon kii ek string ek palyndrome he?loop ke liye ek kaa upyog na karen or apane swayan ke likhane ke bajaay kaaryon main nirmit upyog karne kaa prayaas karen.</s>
<|assistant|>
yahaan ek javascript fnction banane kii ek vidhi he jo jaanch karegi ki kya ek string ek palyndrome he.fnction input string ke rikt sthaan, viraam chihn or puunjikaran ko andekha karata he.

fnction palindrome (str) {
  var regex = /[\ w] /g;
  modstr = str.tolowerCase (). pratisthapit (regex, '');
  reversedstr = modstr.split (''). reverse (). JOIN ('');
  ritern modstr === ulta;
}</s>
