Квиз по JavaScript: Operators & Type Coercion

This JavaScript quiz is about type coercion, the automatic conversions that happen when an operator gets values of different types. You will predict the result of +, -, || and ?? on mixed values and learn which values count as falsy.

Средний 10 вопроса ~6 минуты Проходной балл: 80% Node.js 22

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

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

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

Вопрос 1 из 10

What does this print?

console.log("5" + 3);
Показать ответ

C. 53 When either side of + is a string, + joins strings, so 3 becomes "3" and the result is "53". JavaScript does not throw on mixed types here.

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

  • + joins strings, other math operators convert to numbers
  • Left-to-right evaluation in 1 + 2 + \"3\"
  • NaN from failed number conversion
  • Falsy values and || vs ??
  • Why bigint and number don't mix

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

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

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

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

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