Jquery extend VS pure JS extend
hey guys just came across a extend function in a pure js plugin here , have a look below ::
- NoFrameworkAdapter.extend = function() {
- var args = Array.prototype.slice.call(arguments)
-
- function merge(target, obj) {
- if (typeof target === 'object' && typeof obj === 'object') {
- for (var key in obj) {
- if (obj.hasOwnProperty(key)) {
- target[key] = obj[key]
- }
- }
- }
-
- return target
- }
-
- for (var i = 1, end = args.length; i < end; i++) {
- merge(args[0], args[i])
- }
- return args[0]
- }
now is the above extend function alot similar to how the Jquery extend works ??
i was just curious and so i am asking .
the original source can be found
here.
TY .