Skip to content

Instantly share code, notes, and snippets.

@rjoydip-zz
Created August 3, 2017 10:22
Show Gist options
  • Select an option

  • Save rjoydip-zz/b1cbed97cf9e511416cb3d0d313a2eea to your computer and use it in GitHub Desktop.

Select an option

Save rjoydip-zz/b1cbed97cf9e511416cb3d0d313a2eea to your computer and use it in GitHub Desktop.
'use strict';
let merge = function (){
let _obj = {};
const argv = Array.prototype.slice.call(arguments);
argv.map(function(item){
const key = Object.keys(item);
key.map(function(newKey){
Object.defineProperty(_obj, newKey, {
value: item[newKey],
enumerable: true,
writable: false,
configurable: false,
});
});
});
return _obj;
};
exports = module.exports = merge;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment