JavaScript ES6 7 Awesome Features

  1. let and const
  1. You can only have one rest parameter for a function.
  2. The rest parameter, when present, must be the last parameter.
  3. A rest parameter is not the same as the arguments object. It only captures the remaining arguments after the other named parameters while the arguments object captures all the arguments passed to the function regardless.
  4. A rest parameter cannot be used in an object literal setter.
const totalScore = sum(...scores);

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store