Should I always test JS in the browser?

I'm a beginner js. My question is: should we always use a browser to test JS code? Is there an avilable command line compiler / interpreter?

+3
source share
5 answers

Rhino and Spidermonkey provide standalone interpreters, but you will need to find a DOM implementation if you want to test DOM manipulation, and you need to test in any browsers that you aim for (not all JS engines are created equal).

+5
source

a , - -, , , , , (, , ). , , , .

, (, , ), , dev, .

Javascript , - Firebug, Firefox , Javascript-. , javascript, ( , , ).

+2

JavaScript - , . . , .., , JavaScript. , Windows Script Host - . - - document, window, body, getElementById - , . - .

+1

JavaScript - , JS Selenium. (PHP, Ruby, Java) (, Ruby on Rails...) .

Selenium . , , : Firefox, IE, Opera, .

Selenium - .

, alternatives.

+1

Yes you should. Since the standard is not respected, each browser may behave depending on your code. Therefore, it is better to check it in browsers.

0
source

Source: https://habr.com/ru/post/1766957/


All Articles