@[Link] @coder.
surya @c
@[Link]
JavaScript 30 Interview @[Link]
Question + Answer @c
@[Link] @[Link] Basic Level
@c
@[Link] @[Link] @c
1. What is JavaScript?
Answer: JavaScript is a lightweight, interpreted programming language primarily used to
create interactive and dynamic web content. It's a client-side scripting language that can
@[Link] @[Link] @c
also be used server-side through environments like [Link].
2. What are the data types in JavaScript?
@[Link] @[Link] @c
Answer: JavaScript has several data types: Primitive types (Number, String, Boolean,
Undefined, Null, BigInt, Symbol) and Non-Primitive types (Object, Array).
@[Link] @[Link] @c
3. Explain var, let, and const.
Answer:
@[Link] @[Link] @c
var is function-scoped and can be redeclared and updated.
let is block-scoped and can be updated but not redeclared within the same scope.
const is block-scoped and neither can be updated nor redeclared.
@[Link] @[Link] @c
4. What is == vs === in JavaScript?
Answer: == checks for equality after type conversion (loose equality), while === checks
@[Link] @[Link] @c
for equality without type conversion (strict equality).
5. What is null vs undefined?
@[Link] @[Link] @c
Answer: null is an assignment value representing "no value," while undefined means a
variable has been declared but has not been assigned a value.
@[Link] @[Link] @c
6. Explain NaN in JavaScript.
Answer: NaN stands for "Not-a-Number." It's a special value in JavaScript that results
@[Link] @[Link] @c
when a mathematical operation fails, like parseInt('abc').
7. What are JavaScript functions?
@[Link] @[Link] @c
Answer: Functions are blocks of code designed to perform specific tasks. They can take
parameters and return a value.
@[Link] @[Link] @c
Complete PDF Version Of This Post Is Available in our
Telegram Channel 🫰LINK IN BIO👑
@[Link] @[Link] @c
@[Link]
JavaScript 30 Interview @[Link]
Question + Answer @c
@[Link] @[Link]
Level @c
@[Link] @[Link] @c
1. What is an anonymous function?
Answer: An anonymous function is a function without a name, often used in situations
where functions are used as arguments or within closures.
@[Link] @[Link] @c
2. Explain arrow functions.
@[Link] @[Link] @c
Answer: Arrow functions provide a shorter syntax for writing functions using =>. They
inherit the this value from their enclosing context.
@[Link] @[Link] @c
3. What is an Immediately Invoked Function Expression (IIFE)?
Answer: An IIFE is a function that is defined and immediately executed. Syntax: (function()
@[Link] @[Link] @c
{ ... })();
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link]
Complete PDF Version Of This Post Is Available in our
Telegram Channel 🫰LINK IN BIO👑
@c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link]
JavaScript 30 Interview @[Link]
Question + Answer@c
@[Link] @[Link] @c
Intermediate
@[Link] @[Link] @c
11. What is a closure in JavaScript?
Answer: A closure is a feature in JavaScript where an inner function has access to
variables in its outer function scope, even after the outer function has returned.
@[Link] @[Link] @c
12. What is the purpose of this keyword?
@[Link] @[Link] @c
Answer: this refers to the context in which a function is called. Its value depends on how
the function is invoked (e.g., object method, standalone function, arrow function).
@[Link] @[Link] @c
13. Explain event delegation.
Answer: Event delegation is a technique where a single event listener is added to a parent
@[Link] @[Link] @c
element instead of multiple listeners on individual child elements, utilizing event bubbling.
14. What is the difference between synchronous and
@[Link] @[Link] @c
asynchronous code in JavaScript?
Answer: Synchronous code is executed line-by-line, blocking the next line until the
@[Link] @[Link] @c
current one completes. Asynchronous code allows the program to continue running, using
callbacks, promises, or async/await.
@[Link] @[Link] @c
15. What are promises in JavaScript?
Answer: A promise is an object representing the eventual completion or failure of an
asynchronous operation. It has three states: pending, fulfilled, and rejected.
@[Link]
16. Explain async and await.@[Link] @c
@[Link] @[Link] @c
Answer: async is used to declare asynchronous functions, and await is used to pause the
function execution until a promise is resolved.
17. What is hoisting in JavaScript?
@[Link] @[Link] @c
Answer: Hoisting is a behavior where variable and function declarations are moved to the
top of their scope before code execution. Variables declared with var are hoisted, but not
@[Link] @[Link] @c
initialized.
@[Link] @[Link] @c
@[Link]
JavaScript 30 Interview @[Link]
Question + Answer @c
@[Link] @[Link] @c
Intermediate
@[Link] @[Link] @c
18. What is the bind() method?
Answer: bind() creates a new function that, when invoked, has its this value set to a
specific object.
@[Link] @[Link] @c
19. Explain call() and apply() methods.
@[Link] @[Link] @c
Answer: Both call() and apply() invoke a function with a specified this context. call() takes
arguments individually, while apply() takes them as an array.
@[Link] @[Link] @c
20. What are higher-order functions?
Answer: Higher-order functions are functions that can take other functions as arguments
@[Link] @[Link] @c
or return them as output.
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link]
Complete PDF Version Of This Post Is Available in our
Telegram Channel 🫰LINK IN BIO👑 @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link]
JavaScript 30 Interview @[Link]
Question + Answer@c
@[Link] @[Link] @c
@[Link] @[Link] @c
21. What is the event loop in JavaScript?
Answer: The event loop is a mechanism in JavaScript that manages asynchronous
callbacks. It continuously checks the call stack and the callback queue to execute code in
@[Link] @[Link] @c
a non-blocking manner.
22. Explain prototypal inheritance in JavaScript.
@[Link] @[Link] @c
Answer: Prototypal inheritance is a feature where objects inherit properties and methods
from other objects through the prototype chain.
@[Link] @[Link] @c
23. What is the purpose of the new keyword?
Answer: new is used to create an instance of an object with a constructor function, setting
@[Link] @[Link] @c
this to refer to the new object and linking it to the prototype.
24. What is the purpose of [Link]()?
@[Link] @[Link] @c
Answer: [Link]() creates a new object with a specified prototype object and
properties, allowing for prototypal inheritance without using a constructor.
@[Link] @[Link] @c
25. Explain debouncing and throttling.
Answer:
Debouncing delays function execution until a specified period of inactivity.
@[Link] @[Link] @c
Throttling ensures a function is only executed once in a specific interval.
26. What are modules in JavaScript?
@[Link] @[Link] @c
Answer: Modules allow for separation of code into smaller parts, each with its own scope,
improving maintainability. CommonJS, AMD, and ES6 modules are popular module
@[Link] @[Link] @c
systems.
27. Explain the concept of currying in JavaScript.
@[Link] @[Link] @c
Answer: Currying is the process of transforming a function that takes multiple arguments
into a series of functions that each take a single argument.
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link]
JavaScript 30 Interview @[Link]
Question + Answer @c
@[Link] @[Link] @c
@[Link] @[Link] @c
28. What is memoization in JavaScript?
Answer: Memoization is an optimization technique where results of function calls are
cached to avoid redundant calculations.
@[Link] @[Link]
29. Explain the Singleton pattern.
@c
@[Link] @[Link] @c
Answer: The Singleton pattern restricts a class to a single instance and provides global
access to that instance, useful for managing global states.
@[Link] @[Link] @c
30 What are generators in JavaScript?
Answer: Generators are functions that can pause and resume execution using the yield
@[Link] @[Link] @c
keyword, making them useful for handling asynchronous code and lazy execution.
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link] @c
@[Link] @[Link]
Complete PDF Version Of This Post Is Available in our
@c
Telegram Channel 🫰LINK IN BIO👑
@[Link] @[Link] @c