JavaScript Questions

The following questions can be used as a guide to direct your learning. They are not mandatory

Variables

  1. How do you declare a variable in JavaScript?
  2. What's the difference between var, let, and const?
  3. What are the rules for naming variables in JavaScript?
  4. Can you declare a variable without a value in JavaScript?
  5. What's the scope of a variable declared with var?
  6. What's the scope of a variable declared with let or const?
  7. What's hoisting in JavaScript?
  8. What happens when you try to use a variable that hasn't been declared?
  9. How do you change the value of a variable in JavaScript?
  10. Can you change the value of a const variable?

Conditionals

  1. What's the syntax for an if statement in JavaScript?
  2. How do you add an 'else' clause to an if statement?
  3. How do you chain multiple conditions together using else if?
  4. What's the difference between == and === in conditionals?
  5. How does JavaScript handle truthy and falsy values in conditionals?
  6. What's the syntax for a switch statement in JavaScript?
  7. Can a switch statement handle multiple cases with the same code block?
  8. How do you ensure a switch statement doesn't fall through to the next case?
  9. What's a ternary operator and how does it work?
  10. Can you use nested conditionals in JavaScript? How?

Loops

  1. What's the syntax for a for loop in JavaScript?
  2. What's the syntax for a while loop?
  3. What's the syntax for a do...while loop and how does it differ from a regular while loop?
  4. How do you break out of a loop early?
  5. How do you skip an iteration in a loop?
  6. How do you loop over an array using a for...of loop?
  7. What's the difference between a for...in loop and a for...of loop?
  8. How can you determine the index of the current element in a for...of loop?
  9. What happens when you modify the array during a for...of loop?
  10. Can you use nested loops in JavaScript? How?

Functions

  1. What's the syntax for declaring a function in JavaScript?
  2. What's the difference between a function declaration and a function expression?
  3. What's an arrow function and how does it differ from a regular function?
  4. How do you call a function in JavaScript?
  5. Can a function return a value? How?
  6. Can a function take parameters? How?
  7. What's the difference between parameters and arguments in a function?
  8. How does JavaScript handle default parameters?
  9. How does JavaScript handle extra arguments passed to a function?
  10. What's a callback function?

Array of Objects

  1. How do you declare an array of objects in JavaScript?
  2. How do you access a specific object in an array?
  3. How do you access a property of an object in an array?
  4. How do you change the value of an object's property in an array?
  5. How do you add a new object to an array?
  6. How do you remove an object from an array?
  7. How do you loop over an array of objects?
  8. How do you find an object in an array based on a property value?
  9. How do you sort an array of objects based on a property value?
  10. How do you filter an array of objects based on a property value?