Saturday, February 11, 2017

ES6 - arrow functions, classes, template literals, let and const

Don't forget to install Scratch JS Chrome plugin to play around with ES6.

arrow functions:

Gemstones from MDN web site:

  • Arrow functions does not bind its own this, arguments, super or new.target.
  • Arrow functions are always anonymous
  • They cannot be used for constructor functions.

Read more on MDN web site

Not related but interesting...explanation about function declaration and function expressions.

Classes:

Gemstones from MDN web site:

  • JavaScript classes provide much simpler syntax to create objects.
  • A class can be created using either declaration or expression.
  • Function declarations are hoisted, where as class declarations are not.

Template literals:

Gemstones from MDN web site:
  • Template literals allow embedded expressions
  • They help to create multi-line strings
  • They are enclosed by the back tick

No comments:

Post a Comment