Welcome to the quiz! Try to answer those questions, which cover the topics of this module.
- 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 thedistance
anddestination
properties, and print them in aconsole.log()
? When I callrun()
I want you to print the string “I ran foruntil 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
andvar
declarations in regards to hoisting? - what is a closure?
- what is the difference between
call()
andapply()
- how can we achieve encapsulation in JavaScript?