For prevent hell pyramid programming, I'm looking for use "Promise" with I'm still not familar.
By example, I have this ugly code :
var timeA = 500;
var timeB = 800;
var timeC = 750;
window.setTimeout(function(){
//do stuff 1
window.setTimeout(function(){
//do stuff 2
window.setTimeout(function(){
//do stuff 3
}, timeA);
}, timeB);
}, timeC);
How must I change my code by using Promise mechanism ? Thank you :)