Debian Codegraph @

shallow-copy/example/object.js

raw
1 var copy = require('../');
2
3 var obj = { a: 3, b: 4, c: [5,6] };
4 var dup = copy(obj);
5 dup.b *= 111;
6 dup.c.push(7);
7
8 console.log('original: ', obj);
9 console.log('copy: ', dup);