JS. Advanced JavaScript Questions Breakdown to Crack Any Interview:

 Level            Type

Advanced                             Promises, async/await, event loop, hoisting, this, prototypes, OOP


1. What is a Promise in JavaScript?
➤A Promise represents the eventual result of an asynchronous operation.

2. What is async/await?
➤ A way to write async code that looks synchronous:

async function fetchData() {
    const res=await fetch(url);
}

3. What is hoisting?
➤ JavaScript moves variable and function declarations to the top of their scope before execution.

4. What are the differences between call(), apply(), and bind()?
➤ All are used to set this manually.
  • call() passes args separately
  • apply() passes args as array
  • bind() returns a new function
5. What is the event loop in JavaScript?
➤ It manages execution of code, collecting events, and executing queued sub-tasks (callbacks).


















































Comments

Popular posts from this blog

PHP INTERVIEW QUESTIONS

PHP Intermediate Questions Interview Preparation

PHP Interview Questions (Beginner Level) – Short Answers