Wednesday, November 11, 2015

ES6 (ECMAScript 6) 101

Many companies start to use ES6 to write Javascript codes and use transpilation tool to transform ES6 codes to well-supported ES5 codes.

Here are some concepts (new stuff) in ES6
  • Variables (let, const)
  • Arrow Functions (map, set, =>)
  • Strings (startsWith, endsWith, includes, repeat)
  • TEMPLATE LITERAL (${name})
  • Arrays (Array.from, Array.of, find, findIndex, fill)
  • Math (Math.sign, Math.trunc, Math.cbrt)
  • Spread Operator (...)
  • Destructuring (let [x, y] = [1, 2];)
  • Parameters (function(defaultX = 1), REST PARAMETERS ...remaining)
  • Modules (export function/var, import from, export default)
  • Classes (class, constructor, extends, new)
  • Symbols (getOwnPropertySymbols)
  • Transpilation (Babel, Traceur, TypeScript, ScratchJS) has the complete list and cross browser support status, and some other concepts are not covered above like
  • Proxy
  • Promise
  • Reflect
  • RegExp y and u flags

No comments:

Post a Comment