JavaScript Questions

  1. Describe the difference between a cookie, sessionStorage and localStorage in browsers

  2. Explain event delegation in JavaScript

  3. Explain how "this" works in JavaScript

  4. Explain the concept of "hoisting" in JavaScript

  5. What are JavaScript data types?

  6. What is the difference between let, const, and var?

  7. What is the event loop in JavaScript runtimes?

  8. Describe the difference between <script>, <script async> and <script defer>

  9. What is the difference between a JavaScript variable that is: null, undefined or undeclared?

  10. What are the differences between JavaScript ES2015 classes and ES5 function constructors?

  11. What are JavaScript polyfills for?

  12. What are JavaScript object property flags and descriptors?

  13. What are Symbols used for in JavaScript?

  14. Explain the differences between CommonJS modules and ES modules in JavaScript

  15. Explain the differences on the usage of foo between function foo() {} and var foo = function() {} in JavaScript

  16. What is a typical use case for anonymous functions in JavaScript?

  17. What are the various ways to create objects in JavaScript?

  18. What is a closure in JavaScript, and how/why would you use one?

  19. What is the definition of a higher-order function in JavaScript?

  20. What is the difference between .call and .apply in JavaScript?

  21. Describe event bubbling in JavaScript and browsers

  22. Describe event capturing in JavaScript and browsers

  23. What is the difference between mouseenter and mouseover event in JavaScript and browsers?

  24. What is "use strict" in JavaScript for?

  25. Explain the difference between synchronous and asynchronous functions in JavaScript

  26. What are the pros and cons of using Promises instead of callbacks in JavaScript?

  27. Explain AJAX in as much detail as possible

  28. What are the differences between XMLHttpRequest and fetch() in JavaScript and browsers?

  29. How do you abort a web request using AbortController in JavaScript?

  30. Explain Function.prototype.bind in JavaScript

  31. Why is extending built-in JavaScript objects not a good idea?

  32. Why is it, in general, a good idea to leave the global JavaScript scope of a website as-is and never touch it?

  33. How does JavaScript garbage collection work?

  34. What are the various data types in JavaScript?

  35. What language constructs do you use for iterating over object properties and array items in JavaScript?

  36. What are the benefits of using spread syntax in JavaScript and how is it different from rest syntax?

  37. What are iterators and generators in JavaScript and what are they used for?

  38. Explain the difference between mutable and immutable objects in JavaScript

  39. What is the difference between a Map object and a plain object in JavaScript?

  40. What are the differences between Map/Set and WeakMap/WeakSet in JavaScript?

  41. Why might you want to create static class members in JavaScript?

  42. Explain how prototypal inheritance works in JavaScript

  43. What are server-sent events?

  44. What advantage is there for using the JavaScript arrow syntax for a method in a constructor?

  45. What are JavaScript object getters and setters for?

  46. What are proxies in JavaScript used for?

  47. What tools and techniques do you use for debugging JavaScript code?

  48. What are workers in JavaScript used for?