ES6 notes Two

Source: Internet
Author: User

Module

The idea of the ES6 module is to be as static as possible, so that the dependencies of the modules can be determined at compile time, as well as the input and output variables.

  1. Strict mode ES6 module automatically adopts strict mode
  2. The Export command is used to specify the external interface of the module, a module is a separate file, all variables inside the file, external is not available, if you want to read a variable inside the module, you must use the Export keyword to output the variable.
  3. Import command; change name with AS
  4. The overall load of the module; Specify an object with *, all output values are loaded on this object
  5. Export the default command; Specify the defaults for the module The import command does not use braces; Essentially, export default is to output a variable or method called default, and then the system allows you to take any name for it.
  6. The inheritance of the module;
  7. The essence of ES6 module loading; the COMMONJS module outputs a copy of the value, and the ES6 module outputs a reference to the value. ES6 module encountered module load command Import Yes, will not execute module, but only generate a dynamic read-only reference
  8. Cyclic loading;
  9. Cross-module constants;

ES6 notes Two

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.