~/talk

JavaScript Puzzlers

Talkat CascadiaJS 2013 · 2013-11-14..11-15· [javascript]
slides:none on file

Five short JavaScript puzzles show concrete surprises and fixes: modulus keeps the left-hand sign so -9 % 2 === -1 (fix: check !== 0 or use bitmask), function-level hoisting and lack of block scope break loop variables (fix: declare/assign at top or use let), hitting 2^53 precision limit makes a for loop never advance, IEEE‑754 floating points make 0.6/0.8 math produce 0.207 (fix: use cents for money), and the binary + has higher precedence than ?: so string concatenation yields "hello true" unless parenthesized (order of operations).

AI-written summary · about

  1. 0:00Introduction to puzzlers
  2. 3:04Puzzler one: That's odd
  3. 10:24Puzzler two: The one
  4. 18:05Puzzler three: Loop-de-loop
  5. 25:12Puzzler four: Why are we bankrupt
  6. 29:26Puzzler five: The prestige
~/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.