摘要:
/* * 增加一层环境 */function main(i){ return i}var demo = {}for(var i=0;i<5;++i){ ~function(){ var val = main(i); demo[i] = function(){ return val } }() }console.log(demo[4]())/* * while 循环也一样 */function main(i){ return i}var demo = {};var i = 5;while(i--)... 阅读全文