You are on page 1of 1

Callback hell

function stepOne(callback) {
setTimeout(function () {
console.log("Step One Done");
callback();
}, 1000);
}

function stepTwo(callback) {
setTimeout(function () {
console.log("Step Two Done");
callback();
}, 1000);
}

function stepThree(callback) {
setTimeout(function () {
console.log("Step Three Done");
callback();
}, 1000);
}

function start() {
stepOne(function () {
stepTwo(function () {
stepThree(function () {
console.log("All Steps Done");
});
});
});
}

start();

You might also like