@cool-utils/concatenate
v1.0.0
Published
Combines two objects.
Readme
@cool-utils/concatenate
Combines two objects.
import concatenate from "@cool-utils/concatenate"
const obj1 = {
a: 1,
b: 2,
c: 3
}
const obj2 = {
c: "3",
d: "4",
e: "5"
}
concatenate(obj1, obj2) // { a: 1, b: 2, c: 3, d: '4', e: '5' }Q&A
Question 1
Q: Why does the first object override the keys from the second object?
A: To not mix up the types nor values, we decide that the first value is the "Leader object", where the keys from the 2nd object are not mixed up in a way that the type is never.
