Learn JavaScript

Lesson 6 of 9 · Types, Operators and Coercion: Why '5' + 2 Is Not 7

Module 2 · Types, Operators and Coercion: Why '5' + 2 Is Not 7

Interview Pack: Output Puzzles, the Questions and the Bug Gallery

ProReading

Progsity's Career Path is building a mock interview: a 45-minute video call with an interviewer Progsity names, then a written scorecard. Two of the scorecard's four lines are communication and problem solving, and they are the lines an output puzzle tests. Here is the kind of question an output-puzzle round asks: "What does console.log([] == ![]) print, and why?" A memorised "true" earns little. The algorithm, said out loud, earns both lines.

Checking what this lesson needs for you…

What is inside Interview Pack: Output Puzzles, the Questions and the Bug Gallery

  1. Answering an output puzzle out loud
  2. The ten puzzles, answered by the rules
  3. {} + []: it depends on where you type it
  4. The truthy and falsy table
  5. The six interview questions
  6. The contest angle: where Wrong Answer comes from