ES2016+新特性记录(逐年更新)

  • ES2015
  • ES2016
    1. Array.prototype.includes
    2. Exponentiation operator
  • ES2017
    1. Object.values/Object.entries
    2. String padding
    3. Object.getOwnPropertyDescriptors
    4. Trailing commas in function parameter lists and calls
    5. Async functions
    6. Shared memory and atomics
  • ES2018
    1. Lifting template literal restriction
    2. s (dotAll) flag for regular expressions
    3. RegExp named capture groups
    4. Rest/Spread Properties
    5. RegExp Lookbehind Assertions
    6. RegExp Unicode Property Escapes
    7. Promise.prototype.finally
    8. Asynchronous Iteration
  • ES2019
    1. Optional catch binding
    2. JSON superset
    3. Symbol.prototype.description
    4. Function.prototype.toString revision
    5. Object.fromEntries
    6. Well-formed JSON.stringify
    7. String.prototype.{trimStart,trimEnd}
    8. Array.prototype.{flat,flatMap}
  • ES2020
    1. String.prototype.matchAll
    2. import()
    3. BigInt
    4. Promise.allSettled
    5. globalThis
    6. for-in mechanics
    7. Optional Chaining
    8. Nullish coalescing Operator
    9. import.meta
  • ES2021
    1. String.prototype.replaceAll
    2. Promise.any
    3. WeakRefs
    4. Logical Assignment Operators
    5. Numeric separators
  • ES2022
    1. Class Fields (Private instance methods and accessors, Class Public Instance Fields & Private Instance Fields, Static class fields and private static methods)
    2. RegExp Match Indices
    3. Top-level await
    4. Ergonomic brand checks for Private Fields
    5. .at()
    6. Accessible Object.prototype.hasOwnProperty
    7. Class Static Block
    8. Error Cause