JavaScript spread operator and rest parameters tutorial ES6 / ES2015




Understand new features of JavaScript ECMA6 – spread operator and rest parameters.

The spread operator allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) are expected.

– What is spread operator
– Benefits of using spread operator
– Improving performance using spread operator
– Passing spread operator as a function parameter makes it rest parameters.
– Using spread operator in arrays
– Using spread operator to do array.push

Original source


17 responses to “JavaScript spread operator and rest parameters tutorial ES6 / ES2015”

  1. Very helpful videos.
    I like the idea of not having you in a small window at the right bottom corner any more but now you are floating on the screen background (-;

  2. When turnings the array like object of 'arguments' into an array, you can simply do:
    let args = Array.from(arguments);
    for simplicity sake instead of the Array.prototype.slice.call funkiness.
    Also you should be using 'let' and 'const' instead of 'var' for declaring variables.

Leave a Reply