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”
Understandable examples, please post more concepts on ES6 and TypeScript 🙂
You are sooooo greeeaaaat!..as I said before. 🙂 You're doing great job with ES6!
Looking forward for some TypeScript videos! 😉
[1,2,3].concat([4,5,6])
not a big problem.
… is really usefull as deep copy operator:
b = { …a }
Dear lord, that thumbnail.
var x=function(){
console.log(arguments[0]);
};
x(1,2,3); this will give o/p=>1 how is this possible if arguments is not an array ??
highly underrated, please do come back with more videos. maybe videos on React or Angular !
I just stumbled upon your channel: Thank You!
Noice!!!
thanks!
clean and to the point….
never ever use that shirt again please.
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 (-;
Hi sir… as requested, i am eagerly waiting if you can make a video on creating a sample JS API using the whole concepts you taught us.
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.
Thanks sir.. your videos are the best for practice
and gives us some ideas to think on real stuff.
My parameters are better than the rest 😉
Awesome video! I like it