JS Guide
HomeQuestionsTopicsCompaniesResources
BookmarksSearch

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

ResourcesQuestionsSupport
HomeQuestionsSearchProgress
HomeQuestionsjavascript

javascript

Core JavaScript concepts, ES6+, and language fundamentals

Explore 29 javascript topics to deepen your understanding

Your Progress

0 of 17 completed

0%

17 Questions

junior Level
1
What is the difference between var, let, and const in 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.
2
What are the primitive data types in JavaScript?
junior
data-types
JavaScript has 7 primitive data types: string, number, bigint, boolean, undefined, null, and symbol.
3
What is the difference between map(), filter(), and reduce() array methods?
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.
4
What is the difference between == and === in JavaScript?
junior
operators
== performs type coercion before comparison (loose equality), while === compares both value and type without coercion (strict equality).
5
What is the difference between arrow functions and regular functions?
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.
6
How does JavaScript hoisting work?
junior
hoisting
Hoisting moves variable and function declarations to the top of their scope during compilation. var declarations are initialized as undefined, while let/const enter a Temporal Dead Zone until their declaration is reached.
7
What is event delegation in JavaScript and why is it useful?
junior
events
Event delegation is a pattern where you attach a single event listener to a parent element instead of individual listeners on each child. It works because events bubble up through the DOM, and you can check event.target to determine which child was clicked.
8
How does type coercion work in JavaScript?
junior
type-coercion
Type coercion is JavaScript's automatic conversion of values from one type to another. It happens implicitly with operators like +, ==, and if(), or explicitly using Number(), String(), and Boolean().
9
What is the ternary operator and how does it differ from an if-else statement?
junior
operators
The ternary operator (condition ? valueIfTrue : valueIfFalse) is a concise one-line alternative to if-else that returns a value. Unlike if-else, it's an expression that can be used in assignments, return statements, and JSX.
10
What is a Single Page Application (SPA) and how does it work?
junior
spa
A Single Page Application loads one HTML page and dynamically updates content using JavaScript without full page reloads. The browser handles routing client-side, fetching data via APIs and re-rendering only the parts that change.
11
How do destructuring assignment and spread/rest operators work in JavaScript?
junior
destructuring
Destructuring extracts values from arrays or properties from objects into distinct variables. The spread operator (...) expands iterables into individual elements, while rest (...) collects remaining elements into an array or object.
12
What are the most commonly used string methods in JavaScript?
junior
strings
Key string methods include: length, indexOf/includes for searching, slice/substring for extracting, toUpperCase/toLowerCase for case, trim for whitespace, split for converting to arrays, replace/replaceAll for substitution, and template literals for interpolation.
13
How do you select and manipulate DOM elements in JavaScript?
junior
dom
Use querySelector/querySelectorAll (CSS selectors) or getElementById to select elements. Manipulate them via textContent, innerHTML, classList, style, setAttribute, and createElement/appendChild for creating new elements.
14
How does try/catch work in JavaScript and when should you use it?
junior
error-handling
try/catch wraps code that might throw errors: the try block runs the code, catch handles any error that occurs, and the optional finally block always executes regardless of the outcome. Use it for operations that can fail at runtime like API calls, JSON parsing, and user input processing.
15
What are template literals and tagged templates in JavaScript?
junior
strings
Template literals use backticks (`) instead of quotes, supporting string interpolation with ${expression}, multi-line strings, and embedded expressions. Tagged templates allow you to parse template literals with a custom function for advanced string processing.
16
What is an IIFE (Immediately Invoked Function Expression) and why is it used?
junior
iife
An IIFE is a function expression that is defined and executed immediately, creating a private scope to avoid polluting the global namespace.
17
What are polyfills and how do you implement Array.prototype.map from scratch?
junior
polyfills
A polyfill is code that provides modern functionality in older environments that don't natively support it. Implementing Array.prototype.map requires iterating over the array, calling the callback with each element, index, and the original array, and collecting results into a new array.