make a shallow copy of an object or array
you can copy objects shallowly:
var copy = ;var obj = a: 3 b: 4 c: 56 ;var dup = ;dupb *= 111;dupc;console;console;
and you can copy arrays shallowly:
var copy = ;var xs = 3 4 5 f: 6 g: 7 ;var dup = ;dup;dup5g += 100;console;console;
var copy =
Return a copy of the enumerable properties of the object
obj without making
copies of nested objects inside of
obj is an array, the result will be an array.
obj is an object, the result will be an object.
obj is not an object, its value is returned.
With npm do:
npm install shallow-copy