The difference between node.js and javascript is: JavaScript is a programming language (scripting language), while Node.js is a platform, which can be simply understood as a browser-independent running environment for JavaScript .
The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.
Although it cannot be said that they have nothing to do with each other, they do have little relationship:
First, JavaScript is a programming language (scripting language), and Node.js is a platform. It can be simply understood as an execution environment for JavaScript.
Second, JavaScript used to be executed in the browser and required a JavaScript engine in the browser. Firefox has an engine called Spidermonkey, Safari has a JavaScriptCore engine, and Chrome has a V8 engine.
Now someone has taken out Chrome's V8 engine and packaged it, and added built-in basic modules (mostly written in JavaScript) to form Node.js.
Third, Node.js can be said to be a browser-independent running environment for JavaScript.
Fourth, the content involved in the two is also quite different
[Recommended learning: javascript advanced tutorial]
The above is the detailed content of What is the difference between node.js and javascript?. For more information, please follow other related articles on the PHP Chinese website!