coderwall.com : establishing geek cred since 1305712800

Coderwall Protips Sign In Register Where developers come to connect, share, build and be inspired. Join Coderwall Jake Clarkson JavaScript + Ansible + Bash + MongoDB + Redis (Java + Oracle back in the day) jabclab node.js Share this 22 11401 views node.js January 7, 2014 3:06pm In order to shallow clone an Object in Node.js we can use the following method from util : var extend = require('util')._extend; var original = { foo: 'bar' }; var extended = extend(original, { another: 'attribute' }); // { foo: 'bar', another: 'attribute' } This _extend function can be found in the Node.js source here . I discovered this via this StackOverflow answer . adaniliuk Now Node.js source is https://github.com/joyent/node/blob/master/lib/util.js#L640 It changes over time just because node.js source code changes as well :) EviciMaks You have to...

Linked on 2016-02-17 00:02:36 | Similar Links