摘要: 1 // 转载自: https://gist.github.com/iwillwen/8732729 2 3 'use strict'; 4 5 var arr = [ 1, 2, 3, 4, 5 ]; 6 var fnArr = []; 7 8 // Wrong 1 9 for (var i = 0; i < arr.length; i++) {10 fnArr[i] = function() {11 return arr[i];12 };13 }14 15 fnArr.forEach(function(fn) {16 console.log(fn());1... 阅读全文
posted @ 2014-03-30 11:41 堂哥 阅读(400) 评论(0) 推荐(0) 编辑