extend-object
underscore's extend method adapted and extracted as a standalone CommonJS module.
Note this does not shim Array.prototype.forEach
so if you're in <IE8 you'll need to polyfill it. But basically any other browser will work.
usage
var extend = ; var obj = hi: 'there'; ; console; // {hi: 'there', hello: 'you'} // it extends the first object in placeconsole; // 'true' // you can pass as many objects as you want; // if there are conflicting keys the last one wins;console; // 'newer'
install
npm install extend-object
credits
All credit goes to Jeremy Ashkenas and the other underscore.js authors.
license
MIT as per underscore.