-
-
Save conanak99/71651ac83a12cd0385217a194d033a48 to your computer and use it in GitHub Desktop.
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
// Dùng callback hell | |
xin_mẹ_mua_xe(function(xe) { | |
chở_gái_đi_chơi(xe, function(gái) { | |
chở_gái_vào_hotel(hotel, function(z) { | |
// Làm gì đó, ai biết | |
}); | |
}); | |
}); | |
// Dùng promise, code gọn nhẹ dễ đọc | |
xin_mẹ_mua_xe | |
.then(chở_gái_đi_chơi) | |
.then(chở_gái_vào_hotel) | |
.then(function() { /*Làm gì đó, ai biết*/ }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment