This site runs best with JavaScript enabled.

JavaScript's ...spread Operator

Last tended Jan 20, 2019
Illustrated Notes
Web Development

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

Linked References

JavaScript Bits You Skipped the First Time Around

Being humans, we rarely learn things linearly. No one begins their JavaScript journey by reading the TC39 language specification line-by-line like a pedantic masochist. Instead we all cobble…

A Fresh Serving of JavaScript ES2019

A new version of JavaScript has landed! Every year JavaScript gets a handful of new features and functions for everyone to play with. The TC39 committee have released the 2019 additions to…

A Fruitful Guide to JavaScript's Comparison Operators

Comparing values is one of those essential developer skills that helps you write conditionals , if / then statements, filters , and plenty more. Here's the apples and oranges guide to using them in…

JSX is a Lovechild

If you've had the pleasure of trying to stumble your way through learning React, you'll have been through the adjustment phase with JSX. Putting HTML and JS side-by-side feels like it's violating the…

Want to share?

Join the newsletter

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

Maggie Appleton © 2021