var a = [1,2,3] var arr=[]; for (let i = 0; i < fileArr; i++) { var fn = new Promise(function(resolve, reject) { setTimeout(function(){ console.log(a[i]); }) resolve(a[i]); }) arr.push(fn); } console.log(arr);