A shorthand for Merging JavaScript Objects

> node
Welcome to Node.js v12.3.1.
Type ".help" for more information.

> const init = { first: 'First', last: 'N/A', email: 'first.last@example.com' }

> const fin = { last: 'Last' }

> { ...init, ...fin }
{
first: 'First',
last: 'Last',
email: 'first.last@example.com'
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Wil (₩) Moore III

Wil (₩) Moore III

Technical Writer, Software Engineer Specializing in NodeJS, TypeScript, React & React Native, SQL, DevOps, AWS, Azure, & ElasticSearch. Author of selectn.js.