0% found this document useful (0 votes)
5 views12 pages

Js Interview

The document outlines the top 10 interview questions related to JavaScript, covering topics such as variable declarations, hoisting, closures, event delegation, and the event loop. It explains key concepts like the differences between '==' and '===', promises, and the distinctions between null and undefined. Additionally, it discusses debounce and throttle techniques for optimizing event handling.

Uploaded by

nihongo262
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views12 pages

Js Interview

The document outlines the top 10 interview questions related to JavaScript, covering topics such as variable declarations, hoisting, closures, event delegation, and the event loop. It explains key concepts like the differences between '==' and '===', promises, and the distinctions between null and undefined. Additionally, it discusses debounce and throttle techniques for optimizing event handling.

Uploaded by

nihongo262
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Top 10 Interview

Questions
You need today

www.scribbler.live
What is the difference
between var, let, and const?
var is function-scoped and hoisted
let and const are block-scoped.
const variables can’t be reassigned.
What is hoisting in JavaScript?
JavaScript moves declarations to the
top of their scope.

Functions and var declarations are


hoisted.

let and const are hoisted but not


initialized.
Explain this keyword?
this refers to the object the function is
called on.
In arrow functions, this is lexically
inherited.

Its value depends on how the function is


invoked.
What is a closure?
A function that remembers variables
from its outer scope.

Useful in data privacy and function


factories.

The inner function keeps access even


after outer function ends.
What is event delegation?
Handling events at a parent level
instead of individual child elements

Uses event bubbling to catch events.

Improves performance by reducing event


listeners.
Difference between
== and ===?
== compares value after type coercion.

=== compares value and type strictly.

Always prefer === for reliable comparisons.


What is the event loop?
It handles asynchronous callbacks in
JavaScript.

Runs after the call stack is empty.

Enables non-blocking behavior in a


single-threaded language.
What is a Promise?
An object representing eventual
completion (or failure).

3 states: pending, fulfilled, rejected.

Used for managing asynchronous


operations.
What is the difference
between null and undefined?
undefined: a variable declared but
not assigned.

null: intentional absence of value.

Both are falsy, but used in different


contexts.
What is debounce and
throttle?
Debounce: delays execution until input
stops.

Throttle: limits execution to once every


interval.

Useful for optimizing scroll, resize, and


search input events.
Keep Exploring
Javascript
with us!
Share this with a friend who needs it and
make sure to practice these in scribbler.

Scribbler.live
Free and Open Interface to
experiment JavaScript

You might also like