This site runs best with JavaScript enabled.

JavaScript's ...spread Operator

Last tended on January 20, 2019
🌱 Evergreen


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

Want to share?

Join the newsletter

For weekly notes on visual thinking, ethical technology, and cultural anthropology.

Maggie Appleton © 2020