``` function test(){ for (var i = 0; i < 10; i++) { setTimeout(function(){ console.log(i);//分别输出i的值 },2000) } }; test(); ```