DevPath · Learn to code ESPTEN

JavaScript

➗ Operators and coercion

JavaScript sometimes adds when you think it subtracts. Here you calculate, compare and combine values, and learn why it transforms types on its own so you don't fall into the trap.

What you'll learn

Lessons

Arithmetic and assignment operatorsAdd, subtract, multiply, powers, remainder and shortcuts like += and ++. Comparison and logical operators===, !==, <, >, and how to combine conditions with && || !. Type coercion: == vs ===Why "5" + 1 is "51" but "5" - 1 is 4.
Practice this module in the app

DevPath is a hands-on course: you read the theory here; in the app you put it into practice with exercises that really run, offline.

Start free in the app →