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