Question 11
Consider the following javascript program. What will be logged on to console after executing this program?
const promiseFactory = (isShopOpen) => { return new Promise((resolve, reject) => { setTimeout(() => { if (isShopOpen) { resolve('Making Coffee') } else { reject('Making Tea') } }, 1000) })}
const bringTea = promiseFactory(true)bringTea .then((data) => { console.log(data) }) .catch((data) => { console.log(data) })console.log('Boiling Water ....')Boiling Water ….
Boiling Water ….
Making CoffeeBoiling Water ….
Making TeaMaking Coffee
Boiling Water ….