For loop each way

This code seems correct but is not passing any tests.
When I run the test string “(0_0 :slight_smile: /-\ (: 0-0)” I receive the error “Numeric separator cannot be used after leading 0.” Why is this? I would be grateful to see solutions written with the same techniques.

  function palindrome(string)  {
  let extras = /[\W_]/g;
  let newString = string.replace(extras,"").toLowerCase();
  let forwards = "";
  let backwards = "";
  for (let i = 0; i < newString.length; i++) {
    forwards += newString[i];
    backwards = newString[i] + backwards;
  if (forwards == backwards) {
    return true;
  else  {return false;}
palindrome(0_0 (: /-\ :) 0-0);

I created a rex exp for non-alphanumeric numbers as a variable. That variable was used in replace to delete those symbols.
The string was put in one case.
New string is made visible.
A for loop displays the word forwards and backwards.
A conditional statement compares forwards to backwards spelling.
A boolean returns true for palindromes, false for not.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36 Edg/87.0.664.47.

Challenge: Palindrome Checker

Link to the challenge:

lol the string (: was turn into smiley. Surround by single backticks ` to get it good.

issue is here you need to pass in a string, to do that you need to have it surrounded by quotes, so palindrome("0_0 (: /-\ :) 0-0");

I realized that the argument is not a string. It is missing quotation marks around it.

Let me try that out. :frowning: :)

The code is not working on freeCodeCamp, but works and passes tests on repl. What can I do?

The third mistake I noticed is that my function name was different. My post uses the correct name of the function while my repl’s function has a different name. I changed the named and tests passed.
Thanks, everybody.