make a shallow copy of an object or array
npm install shallow-copymake a shallow copy of an object or array


you can copy objects shallowly:
`` js
var copy = require('shallow-copy');
var obj = { a: 3, b: 4, c: [5,6] };
var dup = copy(obj);
dup.b *= 111;
dup.c.push(7);
console.log('original: ', obj);
console.log('copy: ', dup);
`
and you can copy arrays shallowly:
` js
var copy = require('shallow-copy');
var xs = [ 3, 4, 5, { f: 6, g: 7 } ];
var dup = copy(xs);
dup.unshift(1, 2);
dup[5].g += 100;
console.log('original: ', xs);
console.log('copy: ', dup);
`
` js`
var copy = require('shallow-copy')
Return a copy of the enumerable properties of the object obj without makingobj
copies of nested objects inside of .
If obj is an array, the result will be an array.obj
If is an object, the result will be an object.obj
If is not an object, its value is returned.
With npm do:
```
npm install shallow-copy
MIT