1、返回一个函数数组 result,长度与 arr 相同
2、运行 result 中第 i 个函数,即 result[i](),结果与 fn(arr[i]) 相同
var arr = [1,2,3]; var fn = function (x) { return x * x; } var result = makeClosures(arr,fn); (result[1]() === 4) === (fn(arr[1]) === 4) === true
var arr = [1,2,3]; var fn = function (x) { return x * x; } var result = makeClosures(arr,fn); (result[1]() === 4) === (fn(arr[1]) === 4) === true