In this post, we will see javascript advanced interview questions
What is the difference between synchronous and asynchronous code in JavaScript?
Synchronous code is executed one line at a time, in the order it is written. This means that the next line of code won’t be executed until the current line has completed. For example:
console.log("1");
console.log("2");
console.log("3");
In this example, the console logs will be output in the order 1, 2, 3.
On the other hand, asynchronous code is executed outside the normal flow of execution. This means that code execution continues without waiting for the completion of an asynchronous operation. For example:
console.log("1");
setTimeout(function() {
console.log("2");
}, 1000);
console.log("3");
Explain Event Bubbling in javascript?
Please click here to read answer
Explain Event Capturing ?
Please click here to read answer
What is event delegation model in java script?
Please click here to read answer
What is difference between setTimeout and setInterval?
Please click here to Read Answer:
https://javasavvy.com/javascript-setinterval-vs-settimeout/
Write example for Higher order functions in javascripts?
Please click here to read answer
https://javasavvy.com/javascript-higher-order-functions/
What is a Promise in JavaScript and how does it work?
Please click here to read answer: https://javasavvy.com/javascript-promise-example-code/