CSE 134B Web Client Languages
  1. Resources
  2. Tools
  3. Type explorer

Tool · JavaScript

Type explorer

Two values and an operator in. The result, its type and each conversion step out, computed by JavaScript as you choose.

Open the explorer on its own page, full width, which suits a phone.

How to use it

  1. Operator: pick a left value, an operator (==, ===, +, -, &&, || or ??) and a right value. Read the result and its type, then the steps, each named for the part of the ECMAScript specification it comes from. Predict the result first, then check.
  2. == matrix: == for every pair of the same values. The grid scrolls inside its own box. Choose a cell to open that pair in operator mode. With a keyboard, tab into the grid, move with the arrow keys, and press Enter.
  3. One value: pick a value and read typeof, Number(), String() and Boolean(), with the reason for each.

The values come from a fixed list of the awkward ones. Nothing you type is run. A pair is two separate literals, so [] against [] compares two different arrays. The results come from the real operators, in type-explorer.js, and a test checks every stated result and conversion against JavaScript for every pair.

Learn more