LearnFrenzy
Sign in Take a free test

Functions · JavaScript Functions MCQ · Question 9

fn.length with defaults Answer, explanation & discussion

  • MCQ
  • Hard
  • 0 comments
  • Answer explained
  • Moderated community
Question 9 Back to Exercise

What is ((a, b = 2, c) => {}).length?

  • A 3
  • B 2
  • C 1 Correct
  • D 0
Correct Answer: Option C

length counts only the parameters before the first one with a default (or the rest parameter). c comes after b = 2, so it is not counted either.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links