AI Hints
Home›JavaScript Tutorial›Better Functions
JavaScript · Lesson 42 of 138

Functions Quiz

Test yourself.

⏱ 2 min read▶ Video at 50:29🎓 Free
Watch this lesson in the JavaScript courseWatch on YouTube ↗Full JavaScript course

Let's check your function skills. Pause before each answer.

Functions Quiz
From the video: Functions Quiz
  • Five questions
  • Pause and think
  • Then listen

Question 1

What does a function return if it has no return statement? The answer is undefined.

Quick check
No return statement?

Question 2

What does the arrow function, X, arrow, X times two, return when given five? The answer is ten.

Quick check
(x => x * 2)(5)?

Question 3

What's a closure? The answer is a function that remembers the variables from where it was created.

Quick check
A closure is?

Question 4

What must every recursive function have? The answer is a base case.

Quick check
Every recursive function needs?

Question 5

Which of these passes a callback without calling it? The answer is just the name, with no brackets.

Quick check
Pass without calling?

Summary

Great job. Next, a new section, arrays, for working with lists of values.

Key takeaways
  • Return values
  • Closures remember
  • Base cases
Next up: Arrays — lists of values