1. Explain closures in JavaScript.
Closures are functions that have access to their outer function's scope, even after the outer function has finished executing.
2. What are higher-order functions in JavaScript?
Higher-order functions are functions that operate on other functions, either by taking them as arguments or by returning them.
3. What is a callback function?
A callback function is a function passed as an argument to another function, which is then invoked inside the outer function to complete some kind of routine or action.
4. What is event delegation in JavaScript?
Event delegation is a technique where a single event listener is attached to a parent element to listen for events that occur on its children. This is particularly useful when dealing with dynamically added elements.
5. Explain the concept of prototypal inheritance in JavaScript.
Prototypal inheritance is the mechanism by which objects in JavaScript inherit properties and methods from other objects, known as prototypes.
6. What is the this keyword in JavaScript?
The this keyword refers to the object on which a method is being invoked or the context in which a function is called.
7. How does JavaScript handle asynchronous operations?
JavaScript uses mechanisms such as callbacks, promises, and async/await to handle asynchronous operations.
8. What are JavaScript promises?
Promises are objects representing the eventual completion or failure of an asynchronous operation, and they allow for more readable and manageable asynchronous code.
9. Explain the difference between null and undefined in JavaScript.
represents the intentional absence of any object value, while represents the absence of a defined value.
