'this is about asynchronous processing order. If the callback ends sooner than the next executed code, is the execution order the same in node.js?

const fs = require('fs');
console.log(first);
fs.readFile(file, 'cp949', (error, data) => {
  console.log(second);
});
someFunction();

Assume that the execution time of someFunction() takes longer than the execution time of the callback. Even in this case, is callback called after someFunction() has finished calling?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source