"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > JavaScript - Pioneers of Netscape Nodejs

JavaScript - Pioneers of Netscape Nodejs

Published on 2024-11-02
Browse:541

Ref: http://blog.kueiapp.com/programming-tw/javascript-PIONEERS-netscape-nodejs/

JavaScript 1.0

JavaScript - 的先鋒者們Netscape Nodejs

JavaScript 1.0 was invented by Brendan Eich of Netscape in 1995 for the famous browser Netscape. Java was a very popular language at that time, so Netscape wanted to be as cool as it was and named it JavaScript. However, they are completely unrelated.

Microsoft released two languages ​​that can be executed on the browser in 1996, VBScript and JScript. JScript is actually a clone of JavaScript, used in Internet Explorer 3.

In order to formulate JavaScript standards, Netscape proposed the first global standardization architecture to ECMA International in 1996, and completed the first released version (ES1) in 1997. They call it ECMAScript, the global standard for JavaScript. From the first version to 2022, the most popular version is ECMAScript 2015 (also known as ES6), supported by the most browsers.

Different versions of JavaScript may have different syntax, functionality, libraries, or module systems. To check if our environment can perform it, caniuse.com is a great web information site.

ESMAScript (JavaScript) Candidate List

  • 5th edition: ES5
  • ES6 — ECMAScript 2015
  • ES7 — ECMAScript 2016
  • ES8 — ECMAScript 2017
  • ES9 — ECMAScript 2018
  • NodeJS

In 2008, Google released the Chrome browser, and its JavaScript V8 rendering engine dropped a shock bomb to the online world. Due to the "open source" nature of V8, the NodeJS team modified the engine so that it can easily handle web applications and create servers for back-end applications.

JavaScript module

Due to the emergence of NodeJS, the application of JavaScript is not limited to browsers. Server-side service providers can also use JavaScript. Coding style is not limited to web formats, and many NodeJS applications bring the concept of module programming into the JavaScript world.

Different from the function library, when talking about a module Module, it usually contains a category or a set of functions to achieve a certain purpose. Furthermore, since the JavaScript world is a free and open platform, there are many styles of Modules in JavaScript.

  • CommonJS
  • UMD — Universal Module Definition
  • AMD
  • Require.js
  • ES6 module

Over time, import and require have become the two mainstream modes for using JavaScript Modules.

require

CommonJS style is the earliest writing method that gave rise to the concept of modules.

// a.js
const module = require('module');
module.hello()
// module.js
function hello(){ console.log('hello') }
module.exports = { hello }

import

In the latest ES6 standard, modules can be written as import and export, which seems easier to understand.

// a.js
import module from "module"
module.hello()
// or
import { hello } from "module|
// module.js
export function hello(){ console.log('hello') }
// or
export { hello }

Using NodeJS

JavaScript - 的先鋒者們Netscape Nodejs

NodeJS is an independent execution environment. After installation, we can use the node command to execute JavaScript code in the terminal without a browser.

  • Download and install from nodejs.org
  • Install from a package management system, such as HomeBrew brew install node for macOS
node hello.js
// or omit the extension
node hello

Ref: http://blog.kueiapp.com/programming-tw/javascript-PIONEERS-netscape-nodejs/

Release Statement This article is reproduced at: https://dev.to/kueiapp/javascript-de-xian-feng-zhe-men-netscape-nodejs-2n4j?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3