JS Guide
HomeQuestionsSearchResources
Search

Built for developers preparing for JavaScript, React & TypeScript interviews.

ResourcesQuestionsSupport
HomeQuestionsSearchProgress
HomeQuestionsjavascript

javascript

Core JavaScript concepts, ES6+, and language fundamentals

Your Progress

0 of 6 completed

0%

6 Questions

mid Level
1
What is a closure in JavaScript and why are they useful?
mid
closures
A closure is a function that has access to variables from its outer (enclosing) scope, even after the outer function has returned. They're useful for data privacy, state management, and creating function factories.
2
What are Promises in JavaScript and how do they work?
mid
async
A Promise is an object representing the eventual completion or failure of an asynchronous operation. It has three states: pending, fulfilled, or rejected, and provides .then(), .catch(), and .finally() methods for handling results.
3
How do async/await work and how do they relate to Promises?
mid
async
async/await is syntactic sugar over Promises. An async function always returns a Promise, and await pauses execution until a Promise resolves, making asynchronous code look and behave more like synchronous code.
4
Explain the JavaScript Event Loop and how it handles asynchronous operations.
mid
runtime
The Event Loop is JavaScript's mechanism for handling asynchronous operations. It continuously checks the call stack and task queues, executing callbacks from the microtask queue (Promises) before the macrotask queue (setTimeout, events).
5
How does the 'this' keyword work in JavaScript?
mid
this
The value of 'this' depends on how a function is called: in a method, it refers to the object; in a regular function, it's the global object (or undefined in strict mode); in arrow functions, it's lexically inherited from the enclosing scope.
6
What is the difference between shallow copy and deep copy in JavaScript, and how do you create each?
mid
objects
A shallow copy duplicates only top-level properties while nested objects share references; a deep copy recursively duplicates all nested objects creating fully independent copies.