~/talk

How Does JavaScript Math?

Talkat EmpireJS 2018 · on Thursday, 2018-09-20· [javascript]
slides:none on file

Explains why + sometimes concatenates and sometimes adds by walking actual examples, console experiments, and the ECMAScript rules: ToPrimitive and defaultValue force objects to strings for addition, arrays coerce to comma-joined strings, and unary plus always casts to Number. Demonstrates that {} can parse as an empty block ambiguity, causing surprising zero results, and verifies that subtraction/multiplication/division always coerce to Number. Builds a simple model, tests it in a REPL, and checks the spec to confirm it works.

AI-written summary · about

  1. 0:00Start
  2. 2:16OBJECT TYPES
  3. 3:26DATA STRUCTURES
  4. 15:52STEP 2: GUESS
  5. 16:13STEP 4
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.