Welcome to the quiz! Try to answer those questions, which cover the topics of this module.

You can also write the question/answer into the Discord chat, to make sure it’s correct - other students or Flavio will check it for you!

  • why do we have multiple ways to define functions?
  • how are arrow functions different than regular functions?
  • object destructuring allows to have a nice way to extract prarameter passed as object properties. Can you write a run() function that takes an object as parameter, with the distance and destination properties, and print them in a console.log()? When I call run() I want you to print the string “I ran for until I got to ”.
  • Functions return only one value. Which ways do we have to simulate retruning multiple values from a function?
  • The event loop is crucial to understanding how JavaScript works. Read the lesson on the event loop and then try to explain how it works
  • What would happen if we don’t return anything from a recursive function? Can we even have a recursive function if we don’t return a value?
  • can you explain what hoisting is?
  • what is the difference between let/const and var declarations in regards to hoisting?
  • what is a closure?
  • what is the difference between call() and apply()
  • how can we achieve encapsulation in JavaScript?

Go to the next module