ES7 new features
In ES6, two new features were added: include methods for arrays and the math.pow shorthand syntax.
ES8 new features
1. The asynchronous operation, Object and String capabilities are further enhanced to make code writing more efficient
2, promise.all () improves efficiency
3, the Object. The value () Object. Entries ()
4, the String Padding String. Prototype. PadStart (targetLength, [padString]) targetLength target padString adds String length, Default empty String string.prototype. padEnd(targetLength,[padString]) is used in the same way as padStart()
5. Allow commas at the end
6, Object. GetOwnPropertyDescriptor () for the description of the Object
Running results:
7. SharedArrayBuffer and Atomic provide JS with multi-threaded functions and the main idea of shared memory. Send data or memory address via postMessage. Onmessage listens to the data Atomic to set the thread to sleep
ES9 new features
Mainly solve the traversal of asynchronous, asynchronous normalized operation and other problems, but also provides the object copy, screening function and improve the processing ability of the regular 1, new asynchronous Iterator Asyncchronous Iterator, asynchronous execution statement for… await… of,async generator
The above is synchronous, and the asynchronous iterator is written as follows:
2. Asynchronous generator
3, Promise. Finally ()
4. Extended operator,Rest/Spread
5. Optimization of regular expression
ES10
Although ES10 does not have major changes, JSON fixes, arrays, strings, objects, functions and other capabilities are further enhanced, while the new bigInt data type is particularly notable. 1. Flat method can flatten multi-dimensional arrays, and the default parameter is 1
2, the Object fromEntries (); Returns an array of key-value pairs for the Object’s own enumerable properties, Object.entries(); And the Object. FromEntries () instead
3, String. Prototype. MatchAll returned contains all the regular expression matching and packet capture iterators
TrimStart () trimEnd() remove the beginning and end Spaces. 5. The Catch parameter can be omitted
Array.prototype.sort() allows stable sort of arrays
Function.tostring () normalizes to return exact characters
8, add BigInt data type arbitrary precision integer seventh basic data type
Standardize globalThis object to access global properties on any platform