Sunday, April 7, 2019

How to find Javascript syntax errors




I am writing a JavaScript section of code and am making huge amounts of silly mistakes in the syntax. But the only way to find what line the error is on is to start commenting out the section of code I just wrote and reload it into the browser to narrow down where my missing ');' is.



How do you "compile" a JavaScript source to make sure it is syntactically correct so that I can debug it in the browser?


Answer




Ctrl + Shift + J in firefox, if you don't catch your mistakes until runtime. Of course firebug works better, but this is a quick way.


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...