About javascript Callback Function

  node.js, question

I have always had a question, in most books about callback, it is written like this. js is a single thread, executing one task at a time, thus one task takes a long time to process events, and the following tasks cannot be executed, so there is asynchrony. When a task is finished, it will execute its callback function, and the following tasks need not wait for him to finish, so the sequence of program execution is not the logic of code from top to bottom.

Such as FIA Formula 1 World Championship (F2)

function f1(cb){
 settimeout(function(){
 f1code
 cb()
 },delay)
 bracket

I still can’t understand why FIA Formula 1 World Championship can’t execute f2 until it is finished. Since it is a single thread, why can the following programs such as f3 not wait for FIA Formula 1 World Championship to finish and FIA Formula 1 World Championship is still running, will the thread not be blocked? Also, FIA Formula 1 World Championship will run f2 after running. If f3 needs data processed by FIA Formula 1 World Championship, FIA Formula 1 World Championship has already started before running f3. Is it not wrong?

One or two sentences on this question are not clear. This article is not bad, recommend LZ look at:http://www.phpweblog.net/rain …