Квиз по JavaScript: Functions & Arrow Functions

This JavaScript quiz checks the different ways to define a function. You will predict what arrow functions return, see which functions can be called before their line and learn what arrow functions can't do.

Лёгкий 10 вопроса ~5 минуты Проходной балл: 80% Node.js 22

Выберите режим

Вы играете как гость: войдите, чтобы сохранить XP и серию.

Пример вопроса

Вопрос 1 из 10

What does this print?

const double = (n) => n * 2;
console.log(double(4));
Показать ответ

A. 8 An arrow function with no braces returns its expression automatically. So double(4) returns 4 * 2, which is 8.

Что проверяет этот квиз

  • Function declarations, expressions and arrow functions
  • Implicit return in arrow functions, and when braces need return
  • Returning an object literal from an arrow function
  • Missing arguments become undefined
  • Functions as values in arrays and callbacks

Частые вопросы

Нужен ли аккаунт?

Нет. Играть может любой. Войдите, чтобы сохранять XP, серию, значки и историю.

Можно пройти ещё раз?

Да. Лучший результат сохраняется, а вопросы и ответы каждый раз перемешиваются.