What are the primitive data types in JavaScript?

Heisenbug logo
TheHeisenBug

Search

Search across questions, learning content, and hands-on projects

Ace Your Next Tech Interview

5,986+ interview questions across 87 technologies — with expert answers, advanced search, AI-powered assistance, personal highlights, structured learning paths, and hands-on practice projects.

5,986+Questions & Answers
87Technologies
AdvancedSearch
Built-inAsk AI
PersonalHighlights
StructuredLearning Paths
Hands-onPractice Projects

Lifetime Access

One-time payment. No subscriptions. Unlock everything, forever.

$19.90USD

or R$49.90 BRL

FeatureFreePremium
Question titlesAllAll
Answers per topicTop 5All
Learning chaptersFirst 5All
Practice projectsFirst 3All
Highlights
Ask AI
Read tracking
Search

JavaScript Interview Questions

  1. [JUNIOR] What are the different data types in JavaScript?
  2. [JUNIOR] What is the difference between == and === in JavaScript?
  3. [MID] What is a closure in JavaScript and how would you use one?
  4. [MID] Explain hoisting in JavaScript and what gets hoisted?
  5. [MID] How does the "this" keyword work in JavaScript?
  6. [JUNIOR] What is the difference between var, let, and const?
  7. [JUNIOR] What is the difference between null and undefined?
  8. [JUNIOR] What are arrow functions in JavaScript?
  9. [MID] What are Promises and how do they work?
  10. [MID] Explain the event loop in JavaScript and how it handles asynchronous operations?
  11. [MID] Explain scope and the scope chain in JavaScript?
  12. [MID] What is async/await and how does it simplify asynchronous code?
  13. [JUNIOR] What is the DOM and how is it structured?
  14. [JUNIOR] What are template literals and how are they used?
  15. [JUNIOR] What is the spread operator and how is it used?
  16. [JUNIOR] What are callbacks in JavaScript?
  17. [MID] Explain call(), apply(), and bind() methods in JavaScript?
  18. [MID] Explain event bubbling and event capturing in JavaScript?
  19. [MID] What is event delegation in JavaScript and why does it matter?
  20. [MID] What is the Temporal Dead Zone in ES6?
  21. [MID] Explain prototypal inheritance in JavaScript?
  22. [SENIOR] What are generator functions and iterators in JavaScript and what are they used for?
  23. [SENIOR] What are the differences between Map/Set and WeakMap/WeakSet in JavaScript?
  24. [JUNIOR] What is strict mode in JavaScript and what are its characteristics?
  25. [JUNIOR] What are the primitive data types in JavaScript?
  26. [JUNIOR] What is the difference between synchronous and asynchronous code?
  27. [JUNIOR] What is the difference between map() and forEach()?
  28. [JUNIOR] What is the difference between slice() and splice()?
  29. [JUNIOR] What is destructuring assignment for objects and arrays?
  30. [MID] What are higher-order functions in JavaScript?
  31. [MID] Explain implicit type coercion in JavaScript?
  32. [MID] What is currying in JavaScript and how does it work?
  33. [MID] Explain the difference between shallow copy and deep copy in JavaScript?
  34. [MID] What are the pros and cons of using Promises instead of callbacks?
  35. [MID] Explain the differences between CommonJS modules and ES modules?
  36. [MID] Explain the concept of debouncing and throttling?
  37. [MID] What is the difference between event.preventDefault() and event.stopPropagation()?
  38. [SENIOR] What are Symbols used for in JavaScript?
  39. [SENIOR] What are proxies in JavaScript and what are they used for?
  40. [SENIOR] What are Web Workers and how can they be used to improve performance?
  41. [SENIOR] How does JavaScript garbage collection work?
  42. [SENIOR] How can you optimize DOM manipulation for better performance?
  43. [SENIOR] What are some common performance bottlenecks in JavaScript applications?
  44. [EXPERT] Explain microtasks vs macrotasks in JavaScript with a real example?
  45. [EXPERT] What causes memory leaks in JavaScript applications and how do you detect them?
  46. [JUNIOR] What is the NaN property in JavaScript?
  47. [JUNIOR] What is "truthy" and "falsy" in JavaScript and why is "0" truthy?
  48. [JUNIOR] What are the different types of errors in JavaScript?
  49. [JUNIOR] How do you handle errors using try...catch blocks?
  50. [JUNIOR] What are rest parameters and how are they used?
  51. [JUNIOR] What is the difference between innerHTML and textContent?
  52. [MID] What is memoization in JavaScript and how can it be implemented?
  53. [MID] Describe the difference between a cookie, sessionStorage, and localStorage?
  54. [MID] What are the differences between ES2015 classes and ES5 function constructors?
  55. [MID] What is the difference between a Map object and a plain object in JavaScript?
  56. [MID] How do you handle errors in asynchronous operations?
  57. [MID] What is the use of Promise.all() and how is it different from Promise.allSettled()?
  58. [MID] What is an Immediately Invoked Function Expression (IIFE) and why is it used?
  59. [SENIOR] Why is extending built-in JavaScript objects not a good idea?
  60. [SENIOR] What are JavaScript polyfills and when would you use them?
  61. [SENIOR] Explain the concept of tree shaking in module bundling?
  62. [SENIOR] How do you prevent expensive reflows and repaints in the browser?
  63. [SENIOR] How would you design a concurrency limiter for async tasks?
  64. [SENIOR] How does structured clone differ from JSON serialization?
  65. [EXPERT] How does the JavaScript engine optimize code at a high level?
  66. [JUNIOR] How do you check the data type of a variable in JavaScript?
  67. [JUNIOR] What is the difference between push/pop and shift/unshift?
  68. [JUNIOR] What is the difference between dot notation and bracket notation for accessing object properties?
  69. [JUNIOR] What are default parameters and how are they used?
  70. [JUNIOR] How do you convert a string to a number in JavaScript?
  71. [MID] Is JavaScript a pass-by-reference or pass-by-value language?
  72. [MID] What is the difference between classical inheritance and prototypal inheritance?
  73. [MID] How can closures be used to create private variables?
  74. [MID] Explain the concept of lexical scoping in JavaScript?
  75. [MID] What are the different ways the "this" keyword can be bound?
  76. [MID] What is the difference between document load event and DOMContentLoaded event?
  77. [MID] Explain the difference between function declarations and function expressions?
  78. [SENIOR] What are JavaScript object property flags and descriptors?
  79. [SENIOR] How do you abort a web request using AbortController?
  80. [SENIOR] What is the difference between setTimeout(), setImmediate(), and process.nextTick()?
  81. [SENIOR] Explain the module pattern using closures and why it is useful?
  82. [SENIOR] Explain the concept of Content Security Policy (CSP) and how it enhances security?
  83. [SENIOR] What are server-sent events and how do they differ from WebSockets?
  84. [EXPERT] What is garbage collection in V8 using mark-and-sweep and how does it work?
  85. [JUNIOR] What is the ternary operator and how is it used?
  86. [JUNIOR] What is the difference between a parameter and an argument?
  87. [JUNIOR] What is recursion and how is it used in JavaScript?
  88. [MID] What are the potential pitfalls of using closures?
  89. [MID] Explain the concept of tagged templates in JavaScript?
  90. [MID] What are the differences between XMLHttpRequest and fetch()?
  91. [MID] What is Object.freeze() and how does it differ from const?
  92. [MID] What is Object.seal() and how does it differ from Object.freeze()?
  93. [SENIOR] What are JavaScript object getters and setters and how are they used?
  94. [SENIOR] Explain the concept of the Web Socket API and its use cases?
  95. [SENIOR] Why is it a good practice to leave the global JavaScript scope untouched?
  96. [EXPERT] What are "deopts" in JavaScript engines and what causes them?
  97. [EXPERT] What are TypedArrays and when would you use them?
  98. [JUNIOR] What is the purpose of the break and continue statements?
  99. [JUNIOR] What is the difference between the Window object and the Document object?
  100. [MID] What is the difference between mouseenter and mouseover events?
  101. [MID] Explain the difference between <script>, <script async>, and <script defer>?
  102. [SENIOR] What is the Intl namespace object and what is it used for?
  103. [SENIOR] How do <iframe> elements on a page communicate with each other?
  104. [EXPERT] How does the microtask queue interact with the rendering pipeline in browsers?
  105. [EXPERT] How does V8 handle hidden classes and inline caching for property access optimization?