The spread operator is amazing. It is probably single handedly one of the best bits of javascript functionality to be bestowed upon us.

It allows us to manage immutability,  deconstruct and assign variables in a single line, merge multiple arrays into a single collection.  But wait, that is NOT why I am here today. The reason I stand before you right now is ..., I learnt something else this magnificent operator can do. Take this snippet below;

const post = { title: 'Javascript', sub: 'is great', emotive: 'and I love it!' }

const { title, } = post

Using the spread operator, I can pick  title out of the post object and assign the rest of the properties to a variable called rest.

rest is now an object that does not contain title.

I know, it's a short post, but it was enough to make me smile!

Happy Developing!