Published
Edited
Aug 8, 2021
3 stars
Insert cell
Insert cell
Insert cell
target = ({ a: 1, b: 2 })
Insert cell
target // how ‘weird’: target is different from its initial value
Insert cell
Insert cell
source = ({ b: 4, c: 5 })
Insert cell
returnedTarget = Object.assign(target, source)
Insert cell
Insert cell
returnedTarget === target
Insert cell
Insert cell
target2 = ({ a: 1, b: 2 })
Insert cell
returnedTarget2 = Object.assign({}, target2, source)
Insert cell
target2
Insert cell
Insert cell
returnedTarget2 === target2
Insert cell
Insert cell
({...target, ...source})
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more