Skip to content

set

set(target, key, value)

Creates a new object with the key property set to value.

ts
set({ a: 1, b: 2 }, "a", 3); // { a: 3, b: 2 }
ts
pipe({ a: 1, b: 2 }, set("a", 3)); // { a: 3, b: 2 }