Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 488 Bytes

11_event_loop_and_asynchronous_execution.md

File metadata and controls

21 lines (18 loc) · 488 Bytes

Asynchronous JavaScript Execution with setTimeout()

function washClothes() {
    console.log('washing clothes')
    setTimeout(() => console.log('washing clothes - DONE'), 3000)
}

function cleanDishes() {
    console.log('cleaning dishes')
    setTimeout(() => console.log('cleaning dishes - DONE'), 4000)
}

function cleanHome() {
    console.log('home cleaning')
    setTimeout(() => console.log('home cleaning - DONE'), 5000)
}

washClothes()
cleanDishes()
cleanHome()