Home > Article > Web Front-end > The difference between nodejs and javascript
The difference between nodejs and javascript is: 1. The running file of native js depends on the browser; 2. When nodejs runs the file, the service is the terminal; 3. Native js has compatibility issues, but nodejs does not have compatibility Question; 4. Nodejs can read and write locally, but native js cannot.
The operating environment of this article: windows7 system, nodejs10.16.2&&javascript1.8.5 version, Dell G3 computer.
Introduction to JavaScript:
JavaScript ("JS" for short) is a lightweight, interpreted or just-in-time compiled programming language with function priority. Although it is famous as a scripting language for developing Web pages, it is also used in many non-browser environments. JavaScript is a dynamic scripting language based on prototype programming, multi-paradigm, and supports object-oriented, imperative and declarative (such as functional programming) style.
Introduction to Node.js:
Node.js was released in May 2009 and developed by Ryan Dahl. It is a JavaScript running environment based on the Chrome V8 engine. Use It creates an event-driven, non-blocking I/O model that allows JavaScript to run on the server-side development platform. It makes JavaScript a scripting language on par with server-side languages such as PHP, Python, Perl, and Ruby.
Node.js optimizes some special use cases and provides alternative APIs to make V8 run better in non-browser environments. The V8 engine executes Javascript very quickly and has very good performance. It is based on Chrome JavaScript The platform established at runtime is used to easily build network applications with fast response speed and easy expansion.
The difference between Node Js and JavaScript and the advantages and disadvantages of nodejs.
1. The native js running file depends on the browser;
2. When nodejs runs the file, the service is the terminal;
3. The native js has compatibility Problem, nodejs does not have compatibility issues;
4. nodejs can perform local reading and writing, server setup, database connection, etc., but native js cannot do this.
Advantages of nodejs: equivalent to the use of the middle layer in the project
Disadvantages: not suitable for a large number of operations
Recommended learning: "javascript advanced Tutorial》
The above is the detailed content of The difference between nodejs and javascript. For more information, please follow other related articles on the PHP Chinese website!