es6 modular specification

Until there is no block es6 this concept, es6zhong introduced: Actual follows:

If xx1 and xx2 has the same variable names, and introduced in the same html, need to add type = "module" attribute to the script tag introduced.
Note: You can not use the file protocol, you need to put up the server


The members of the Export module:
with export to export module members, need to export more to put an object, separated by commas.
Want to export renamed: e.g. want to export a, b, to be renamed as c, d: {a as c , b as d}
default function deriving default + + export various members

When introduced: import xx form + "path", each module has a default export only, so the show path can import their own definition of the name when imported
renamed and renamed consistent approach when exporting is introduced, in addition to export instead import
import everything All members of the target export module:
Import * AS MOD1 from "path": changed names, mainly for fear of conflict.

Import Export Members of no force module:
Import 'path': The main purpose is to allow the module to perform this path once, and only the first time the introduction of execution.
* Import speaking members of reexport: a x1 to x2, directly into the x2 x3.


In addition to the original five primitive types add a symbol (symbol) again
to ensure that the name of each property is unique, to prevent the property from a fundamental conflict.


weaksrt set:
SET collections:
Map set:
three line set further particular reference to official website


asynchronous programming promise object:
This object represents an asynchronous programming, three states,
. 1: Pending carried out in
2: fufiled Successfully
3: rejected failed

By new calls, a function as a parameter, the first parameter is a function performed when the function succeeds, the second function is performed when a failure, or the value of the execution result. Will be passed down to continue the call succeeds when the following with promise.then value, as a function of the value passed with promise.catch method, the parameter is a function, function parameters are passed down from the above values ​​or failure result.

More commonly used for block-level part of the specification, and the next I am going to write a simple common git commands

Guess you like

Origin www.cnblogs.com/zhushuaiqi/p/12076038.html