hawx1993
6/25/2016 - 11:14 AM

fn.js

//bind
 function bind(fn, ctx) {
    return function (a) {
      var l = arguments.length;
      return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);
    };
  }
  
  
  //entend
    function extend(destination, source) {
        for (var property in source) destination[property] = source[property];
    return destination;
  }