Created
August 3, 2017 10:22
-
-
Save rjoydip-zz/b1cbed97cf9e511416cb3d0d313a2eea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '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