js-helpers

Merge

Merge (Object object1[, …Object objects])

Overwrites the values of object1 with values of objects. Adds all missing values of objects to object1.

Arguments

Object object1

Any object

[…Object] objects

Any number of objects to overwrite object1 values with.

Use

import { Merge } from "@taystack/js-helpers";

const obj = {a: 1, b: 1};
Merge(obj, {b: 2}, {c: 3});
obj // {a: 1, b: 2, c: 3};

Source: @taystack/js-helpers hosted on GitHub Author: taystack