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
// apply 的模拟实现 | |
Function.prototype.apply = function(context, arr) { | |
var context = Object(context) || window; | |
context.fn = this; | |
var result; | |
if (!arr) { | |
result = context.fn(); | |
} else { | |
var args = []; |