This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeRequest(arg) { | |
return new Promise(res => { | |
setTimeout(() => res(arg), 2000); | |
}); | |
} | |
const person = { | |
name() { | |
return makeRequest("Mikita"); | |
}, | |
age() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.youtube.com/watch?v=cCOL7MC4Pl0 | |
const button = document.getElementsByTagName('button')[0] | |
button.addEventListener('click', () => { | |
setTimeout(() => console.log('Timeout 1')) | |
Promise.resolve().then(() => console.log('Microtask - 1')) | |
console.log('task 1') | |
}) |
OlderNewer