~/talk

Pattern matching in JavaScript

TalkinSpanishat NodeConf Argentina 2018 · 2018-10-18..10-20· [javascript, typescript]
slides:none on file

Explains why switch statements in JavaScript are problematic: fallthrough can trigger multiple cases, case clauses are evaluated early causing runtime errors from missing globals and hidden shared state, and Redux reducers can break when actions lack expected fields. Compares alternatives such as chained if/else, nested ternaries, and an object-of-functions reducer pattern that defers evaluation, and points to a language-level solution via the TC39 Stage 1 pattern-matching proposal with Elixir/Rust-style matches and a macro playground for experimentation.

AI-written summary · about

  1. 0:00Start
  2. 10:33Using an object
  3. 14:10Redux reducer
  4. 18:06Rust
  5. 19:57But first
  6. 20:25Destructuring
~/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.