Welcome to the quiz! Try to answer those questions, which cover the topics of this module.
- write the code needed to call the
bark()
function if thedogIsHungry
variable is true, and thesleep()
function if it’s false - in a switch statement, why do we need to add a break or a return at the end of each switch case?
- what are the ways we can break out of a
for
loop? - describe all the different ways to create a loop in JavaScript
- explain in your own words how can “immediately invoked function expressions” help when it comes to using the loop index inside a function, inside the loop. Why do we have to wrap them in an additional function?