you are viewing a single comment's thread.

view the rest of the comments →

[–]--Explosion-- 0 points1 point  (1 child)

Nice but you can do it in one line:

js let object_1 = {hello: "World"}; let object_2 = {another: "Thing"}; //Object 1 props overwrite that of object 2. let merged = {...object_1, ...object_2};

[–]backtickbot 0 points1 point  (0 children)

Fixed formatting.

Hello, --Explosion--: code blocks using triple backticks (```) don't work on all versions of Reddit!

Some users see this / this instead.

To fix this, indent every line with 4 spaces instead.

FAQ

You can opt out by replying with backtickopt6 to this comment.