evergreen

JavaScript's ...spread Operator

Illustrated notes on how JavaScript's spread operator works

Spreading the elements from one array and copying them into is one of those handy shorthands for moving data around in JavaScript.

I started looking into it after seeing <ComponentName {...props} /> in lots of React projects, and couldn’t figure out what on earth was going on with the props syntax.

Mystery solved…

JavaScript's spread operator copies the content of one array, and dumps them out into another

Want more illustrated notes on web development?

Take a look at JSX is a Lovechild , How Are Compilers & Transpilers Different? or [[A Fruitful Guide to JavaScript’s Comparison Operators]]