Почему не работает 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);

→ Ссылка