JS Guide
Home
Questions
Topics
Companies
Resources
Bookmarks
Search
Toggle theme
Open menu
Home
Questions
Search
Progress
Home
Questions
Browse All Questions
188 questions across 9 categories
Filters
Showing all 188 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.
How does JavaScript hoisting work?
javascript
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.
What is event delegation in JavaScript and why is it useful?
javascript
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.
How does type coercion work in JavaScript?
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().
What is the ternary operator and how does it differ from an if-else statement?
javascript
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.
What is a Single Page Application (SPA) and how does it work?
javascript
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.
Showing 10 of 188 questions
Load More