Questenaتدريب يوضح لك ما ينبغي مراجعته لاحقًا
السؤال 76

The arrow function pick is written as a => a. What happens when pick(4, 9) is evaluated?

  1. It returns 9 because the last argument wins
  2. It returns an array containing 4 and 9
  3. It throws an arity error before the body runs
  4. It returns 4 and the extra argument does not block the callالإجابة الصحيحة

الشرح

The call is valid even though it supplies more arguments than pick has named parameters. The parameter a receives 4 and the expression returns it; JavaScript does not enforce an exact argument count for an ordinary call.

تابع هذا الاختبار

بدء التدريب
السؤال 76: The arrow function pick is written as a => a. What happens… · JavaScript Fundamentals · Questena