Last active
August 29, 2015 14:05
-
-
Save simongong/6d945c600d847865f8c4 to your computer and use it in GitHub Desktop.
JavaScript: jsExtend
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
var isFunction = function(target){ | |
var getType = {}; | |
return !!target && | |
(getType.toString.call(target) === '[object Function]' || | |
typeof target === 'function'); | |
}; | |
var objectExtend = function(where) { | |
Array.prototype.slice.call(arguments, 1).forEach(function(source) { | |
var key; | |
for (key in source) { | |
if (source.hasOwnProperty(key)) { | |
where[key] = source[key]; | |
} | |
} | |
}); | |
return where; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment