Why do I keep getting this syntax error from chrome console?

Why do I keep getting this syntax error from chrome console?
0

#1

As the title said, I was keeping getting this syntax error message from chrome, and the strange thing is sometimes my code does execute, sometimes I just got this error. I tried to use clear() to clean my console, but it did not work.

And also does anyone knows a stable js console/editor I can use for learning js? I want the console/editor give me accurate result cos I don’t want to second guess myself.


#2

Have you tried refreshing the page? It sounds like the constants are still living in your window object so when you try to set them again, you get an error.


#3

That worked.

Is everyone who’s learning js all use chrome’s console? Or there is a better option?
I just want an IDE that can execute js, like codeblock for c++ or something.