- Describe how asynchronus code differs from synchronous code
- Create chained asynchronous events
- Explain what the drawbacks of callbacks are when handling chained async events
- Use Promises to flatten async events
- Use Promises to return async event from a function
What is the output of the following code?
console.log(1)
console.log(2)
setTimeout(function(){
console.log(3)
},1000)
console.log(4)
console.log(5)
Use setTimeout
to create a countdown from 5 in real time
What is the callback pyramid of death? Why is it a bad pattern?
Use the following example code to create a countdown -> https://repl.it/repls/DecentLopsidedSupport
Create a function named countFrom5
that counts down from 5 and returns a promise.