TGViewer
Web Development - HTML, CSS & JavaScript Web Development - HTML, CSS & JavaScript @javascript_courses · 55.7K subscribers
Post #2672 2.22K
What is the purpose of the “map” method in JavaScript? map() creates a new array with the results of calling a provided function on every element.

What is a promise in JavaScript? A promise is an object representing the eventual completion or failure of an asynchronous operation.

How do you handle errors in promises? Use .catch() or a try...catch block inside an async function.

Explain the concept of currying in JavaScript. Currying is transforming a function with multiple arguments into a sequence of functions each taking a single argument.

What is the purpose of the “reduce” method in JavaScript? reduce() applies a function to accumulate values in an array into a single result.

What is the difference between “null” and “undefined” in JavaScript?
null is an assignment value.
undefined means a variable has been declared but not assigned.

What are the different types of loops in JavaScript?
for, while, do...while
for...of, for...in
Array.forEach()

What is the difference between “let,” “const,” and “var” in JavaScript?
var is function-scoped, hoisted, can be re-declared.
let is block-scoped, cannot be re-declared in the same scope, can be reassigned.
const is block-scoped, cannot be re-declared or reassigned.

Explain the concept of event propagation in JavaScript. Event propagation includes capturing, target, and bubbling phases. JavaScript uses bubbling by default.


What are the different ways to manipulate the DOM in JavaScript?
getElementById(), querySelector(), createElement()
innerHTML, textContent, classList, setAttribute()


What is the purpose of “localStorage” and “sessionStorage”?
localStorage stores data with no expiration.
sessionStorage stores data for the session.


How do you handle asynchronous operations in JavaScript? Using callbacks, promises, or async/await syntax.


What is the purpose of the “forEach” method in JavaScript? forEach() executes a provided function once for each array element.


What are the differences between “let” and “var”?
let is block-scoped; var is function-scoped.
let cannot be accessed before declaration (Temporal Dead Zone).


Explain the concept of memoization in JavaScript. Memoization caches the results of function calls to avoid recalculating the same result.


What is the purpose of the “splice” method in JavaScript arrays? splice() adds/removes/replaces elements in an array in-place.


What is a generator function in JavaScript? A generator function (function*) can pause and resume execution using yield. It returns an iterator.


How does JavaScript handle variable scoping? Variables can be globally, function, or block scoped depending on how they are declared (var, let, const).


What is the purpose of the “split” method in JavaScript? split() splits a string into an array of substrings based on a specified separator.


What is the difference between a deep clone and a shallow clone of an object?
Shallow clone copies only references to nested objects.
Deep clone creates independent copies of all nested objects.


Explain the concept of the event delegation pattern. Event delegation attaches a single listener to a parent element to handle events from child elements via event bubbling.


What are the differences between JavaScript’s “null” and “undefined”?
null is intentional absence of value.
undefined means no value has been assigned.


What is the purpose of the “arguments” object in JavaScript? arguments is an array-like object accessible inside regular functions that contains the passed arguments.


What are the different ways to define methods in JavaScript objects?
Traditional function syntax
Shorthand method syntax
Arrow functions (not recommended due to this binding issues)


Explain the concept of memoization and its benefits. Memoization is storing the result of expensive function calls to improve performance for repeated inputs.
  • ❤ 2
More from @javascript_courses
  1. Oct 12, 2026doesn't work because "a" is block-scoped. ⭐ 1️⃣5️⃣ What Is an Execution Context? When Java…
  2. Oct 12, 2026When "inner()" looks for: name it finds it in its own scope. For: city JavaScript looks in…
  3. Oct 12, 2026💻 JavaScript Roadmap 2026 — Part 9 🟡 Scope, Hoisting & Execution Context Now we're movin…
  4. Oct 12, 2026🚀 𝗪𝗵𝗶𝗰𝗵 𝗧𝗲𝗰𝗵 𝗦𝗸𝗶𝗹𝗹 𝗪𝗶𝗹𝗹 𝗬𝗼𝘂 𝗠𝗮𝘀𝘁𝗲𝗿 𝗶𝗻 𝟮𝟬𝟮𝟲? Want to buil…
  5. Oct 9, 2026🇮🇳 𝗚𝗢𝗩𝗘𝗥𝗡𝗠𝗘𝗡𝗧 𝗢𝗙 𝗜𝗡𝗗𝗜𝗔 — 𝗔𝗜𝗖𝗧𝗘 𝗜𝗡𝗧𝗘𝗥𝗡𝗦𝗛𝗜𝗣𝗦 𝟮𝟬𝟮𝟲 🚀…
  6. Oct 8, 2026🎓 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝘄𝗶𝘁𝗵 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗲𝘀! 🚀🔥 Upgr…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →