Skip to content

Chapter 3

  • Describe event bubbling.
  • Describe event capturing.
  • What is the difference between an “attribute” and a “property”?
  • Explain the same-origin policy with regards to JavaScript.
  • What is the difference between event.target and event.currentTarget?
  • What is the difference between event.preventDefault() and event.stopPropagation()?
  • What is the DOM?
  • How do you select elements with Vanilla JavaScript?
  • Explain event delegation in JavaScript.
  • what is the purpose of the addEventListener method?
  • How do you create and remove elements in the DOM?
  • Explain the concept of event propagation.
  • How can you prevent the default behaviour of an event?
  • What is the purpose of the data- attribute in HTML?
  • Describe the difference between innerHTML and textContent.
  • How do you handle asynchronous code in JavaScript?

Micelleneous

  • What language constructions do you use for iterating over object properties and array items?
  • What are the pros and cons of extending built-in JavaScript objects?
  • What is the difference between == and ===?
  • Why is it called a Ternary operator, what does the word “Ternary” indicate?
  • What is strict mode? What are some of the advantages/disadvantages of using it?
  • What are some of the advantages/disadvantages of writing JavaScript code in a language that compiles to JavaScript?
  • What tools and techniques do you use debugging JavaScript code?
  • Explain the difference between mutable and immutable objects.
    • What is an example of an immutable object in JavaScript?
    • What are the pros and cons of immutability?
    • How can you achieve immutability in your own code?
  • Explain the difference between synchronous and asynchronous functions.
  • What is event loop?
    • What is the difference between call stack and task queue?
  • What are the differences between variables created using let, var or const?
    • Can you change a property of an object defined via const? How you can change this behavior?
  • What are the differences between ES6 class and ES5 function constructors?
  • Can you offer a use case for the new arrow => function syntax? How does this new syntax differ from other functions?
  • What advantage is there for using the arrow syntax for a method in a constructor?
  • What is the definition of a higher-order function?
  • Can you give an example for destructuring an object or an array?
  • Can you give an example of generating a string with ES6 Template Literals?
  • Can you give an example of a curry function and why this syntax offers an advantage?
  • What are the benefits of using spread syntax and how is it different from rest syntax?
  • How can you share code between files?
  • Why you might want to create static class members?
  • What is the difference between while and do-while loops in JavaScript?
  • What is a promise? Where and how would you use promise?
  • Discuss how you might use Object Oriented Programming principles when coding with JavaScript.

TOP - 30 Indian Trivia Questions

1-10: Basics of JavaScript

  1. What is JavaScript?
  2. Explain the difference between let, const, and var.
  3. How does hoisting work in JavaScript?
  4. Describe the concept of closures.
  5. Explain the event loop in JavaScript.
  6. What is the difference between == and ===?
  7. How do you check the type of a variable in JavaScript?
  8. What is the use of the this keyword in JavaScript?
  9. Explain the difference between function declaration and function expression.
  10. How does the setTimeout function work?

11-20: Functions and Scope

  1. What is a callback function?
  2. Explain the concept of a pure function.
  3. Describe the differences between function.call, function.apply, and function.bind.
  4. What is the purpose of the arguments object in a funct
  5. How do you create a closure in JavaScript?
  6. What is the use of the bind method?
  7. What is the difference between a shallow copy and a deep сору?
  8. How does the call stack work in JavaScript?
  9. Explain the concept of function currying.
  10. How can you avoid callback hell in JavaScript?

21-30: Objects and Prototypes

  1. What is prototypal inheritance?
  2. How do you create an object in JavaScript?
  3. What is the purpose of the prototype property in Javas
  4. Explain the difference between Object.create and the constructor pattern.25. How do you add a property to an object in JavaScript?
  5. What is the hasOwnProperty method used for?
  6. How can you prevent modification of object properties in JavaScript?
  7. Describe the use of the new keyword.
  8. Explain the concept of Object Destructuring in JavaScript.
  9. What is the difference between null and undefined?