TIL Spreading a object into another object
POSTED ON:
TAGS: codepen javascript
Sometimes, I do stuff for a long time and tiny details like this blow me away. This neat trick is one of those times.
const user = {
firstName: "Rocky",
lastName: "Kev"
}
const betterUser = { ...user, superPower: "taking notes" };
See the Pen spread-array-test by rockykev (@rockykev) on CodePen.
Related TILs
Tagged: codepen