JS Guide
HomeQuestionsSearchResources
Search

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

ResourcesQuestionsSupport
HomeQuestionsSearchProgress
HomeQuestions

Browse All Questions

115 questions across 7 categories

Filters

Showing all 115 questions

What is the difference between var, let, and const in JavaScript?
javascript
junior
variables
var is function-scoped and can be redeclared, let is block-scoped and can be reassigned, const is block-scoped and cannot be reassigned after initialization.
What are the primitive data types in JavaScript?
javascript
junior
data-types
JavaScript has 7 primitive data types: string, number, bigint, boolean, undefined, null, and symbol.
What is the difference between map(), filter(), and reduce() array methods?
javascript
junior
arrays
map() transforms each element and returns a new array of the same length, filter() returns elements that pass a test, and reduce() accumulates array elements into a single value.
What is the difference between == and === in JavaScript?
javascript
junior
operators
== performs type coercion before comparison (loose equality), while === compares both value and type without coercion (strict equality).
What is the difference between arrow functions and regular functions?
javascript
junior
functions
Arrow functions have a shorter syntax, don't have their own 'this' binding (they inherit from the enclosing scope), cannot be used as constructors, and don't have access to the 'arguments' object.
What is a closure in JavaScript and why are they useful?
javascript
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.
What are Promises in JavaScript and how do they work?
javascript
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.
How do async/await work and how do they relate to Promises?
javascript
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.
Explain the JavaScript Event Loop and how it handles asynchronous operations.
javascript
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).
How does the 'this' keyword work in JavaScript?
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.

Showing 10 of 115 questions