1. function muti(num){
    2. return new Promise((resolve,reject)=>{
    3. setTimeout(()=>{
    4. resolve(num*num)
    5. },1000)
    6. })
    7. var arr =[2,3,4]
    8. // for - of
    9. (async ()=>{
    10. for(let value of arr){
    11. const res = await muti(value)
    12. console.log(res)
    13. }
    14. })
    15. // forEach
    16. arr.forEach(async item=>{
    17. const res = await muti(item)
    18. console.log(res)
    19. })