JavaScript,JavaScript is a scripting language with its own syntax and semantics, without JavaScript, and no other concepts.
About ES6, which can be directly understood as the enhanced version of JavaScript (adding new specifications, features and functionality) or the latest version, although slightly different, but also can be ignored (do not care about these details, hehe), a bit similar to the JAVA8 and Java language relationship, Also since there are ES6, there are also es 5 and Es 3, both of which are published in the development process of JavaScript.
Commonjs, AMD, and once-very-hot cmd are just a way to solve the dependency and reference problems between JavaScript files, so they are only a JavaScript package management specification . When you organize your JS code, you can choose the appropriate package management specifications according to your preference, but be careful to choose only one as much as possible.
Before the advent of Nodejs, JavaScript was primarily applied to the browser side, so Nodejs also understood that Nodejs was an extension of the application of JavaScript out of the browser, which also provided a running engine and related APIs, so Nodejs is a development kit for JavaScript to develop native applications, server applications , and note that because Nodejs uses JavaScript syntax, NODEJS is not a development language.
http://blog.csdn.net/yiifaa/article/details/54376458
ES6 {
Export: ' Can output multiple, output mode is {} ',
Export default: ' Only one output can be output with export, but it is not recommended ',
The parsing phase determines the external output interface, and the parsing phase generates an interface,
The module is not an object, the object is not loaded,
One of the interfaces (methods) can be loaded separately,
Static analysis, dynamic referencing, the output is a reference to the value, the value changes, the reference also changes, that is, the value in the original module changes, the value of the load will also change,
This point undefined
}
CommonJS {
Module.exports = ...: ' Can only output one, and the back will cover the above ',
Exports. ...: ' Can output multiple ',
The runtime determines the interface and the runtime loads the module,
The module is an object, the object is loaded,
The entire module is loaded, all the interfaces are loaded in,
The output is a copy of the value, that is, the value change in the original module does not affect the value that has already been loaded.
This points to the current module
}
Commonjs compared to ES6, AMD, and cmd