- JScript code
function fn(arr) { for (var i=0;i < arr.length;i++) { arr[i]=function () { document.write(i); document.write(arr[i]); //为什么这里没有变成a,b,c? }; arr[i](); document.write("<br />"); } } var arr = ['a','b','c']; fn(arr);
------解决方案--------------------
http://topic.csdn.net/u/20120825/12/66d50db3-4fad-4eeb-a3f3-c0177f8e846e.html?45678