Почему не работает callback?
Не выводиться second().
function first(){
setTimeout(function () {
console.log(1);
})
}
function second(){
console.log(2)
}
first(second);
//second();
Ответы (1 шт):
Автор решения: Igor
→ Ссылка
function first(cb) {
setTimeout(function() {
console.log(1);
cb();
});
}
function second() {
console.log(2)
}
first(second);