📌  相关文章
📜  javascript代码示例中的异步

📅  最后修改于: 2022-03-11 15:04:31.685000             🧑  作者: Mango

代码示例4
const printProcess = () => {
    console.log('it will print 2nd');
    var currentTime = new Date().getTime();
    while (currentTime + 3000 >= new Date().getTime());
    console.log('it will print after added 3 second with current time')
}

console.log('it will print 1st ');
printProcess(); //follow arrow funtion after 1st print
console.log('it will print at the end');
//Expected output below:
// it will print 1st 
// it will print 2nd
// it will print after added 3 second with current time
// it will print at the end