Skip to content

Instantly share code, notes, and snippets.

@kor-Chipmunk
Last active June 13, 2021 03:34
Show Gist options
  • Save kor-Chipmunk/1355fb16ca0d2eef59a12369deb69c6c to your computer and use it in GitHub Desktop.
Save kor-Chipmunk/1355fb16ca0d2eef59a12369deb69c6c to your computer and use it in GitHub Desktop.
Q1
const fs = require('fs');
const aaa = () => {
setTimeout( () => { console.log('d'); }, 0);
console.log('c');
};
setTimeout( () => {
fs.readFile('any.txt', () => {
setTimeout(() => {
console.log('e');
}, 0);
setImmediate(() => {
console.log('f');
});
});
}, 100 );
setTimeout( () => { console.log('a'); aaa(); }, 0 );
Promise.resolve().then( () => { aaa(); console.log('b'); });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment