This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const promise = checkWeather('Delhi'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
checkWeather('Delhi', (weather) => { | |
if (weather === 'well') { | |
return checkFlights('Mumbai', (flights) => { | |
buyTicket(flights[0], (ticket) => { | |
console.log('ticket no. %d', ticket.number); | |
}); | |
}); | |
} | |
console.log('the weather is bad'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeBurger = nextStep => { | |
getPotato(function (potato) { | |
cookPotato(potato, function (cookedPotato) { | |
getBuns(function (buns) { | |
putPattyBetweenBuns(buns, potato, function(burger) { | |
nextStep(burger) | |
}) | |
}) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeBurger = () => { | |
getPotato(function(potato) { | |
cookPotato(potato, function(cookedPotato) { | |
getBuns(function(buns) { | |
putPattyBetweenBuns(buns, potato, function(burger) { | |
// Serve the burger | |
}); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeBurger = () => { | |
getPotato(function(potato) { | |
cookPotato(potato, function(cookedPotato) { | |
getBuns(function(buns) { | |
// Put patty in bun | |
}); | |
}); | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeBurger = () => { | |
getPotato(function(potato) { | |
// We can only cook potato after we get it. | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const makeBurger = () => { | |
const potato = getPotato(); | |
const patty = cookPotato(potato); | |
const buns = getBuns(); | |
const burger = putPattyBetweenBuns(buns, patty); | |
return burger; | |
}; | |
const burger = makeBurger(); | |
serve(burger); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Learning') | |
setTimeout(function() { | |
console.log('Asynchronous') | |
}, 5000) | |
console.log('JavaScript') | |
/* Output: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('Learning') | |
console.log('Asynchronous') | |
console.log('JavaScript') | |
/* Output: | |
Learning | |
Asynchronous |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"start": "webpack-dev-server --mode development --hot --open", |
NewerOlder