~/talk

Understanding Functions and "this" in the World of ES2018

Talkat Silicon Valley Code Camp 2018 · 2018-10-13..10-14· [javascript]
slides:none on file

Explains that JavaScript sets this by how a function is called — call-site determines this — so plain function calls get global/window, object.method calls get the object, and callbacks like setTimeout lose the object. Covers call/apply/bind, shows arrow functions lexically bind this (call/apply/bind don’t affect them), notes the surprising ignored this when calling an arrow via call, and previews class field declarations with arrow methods to avoid React binding boilerplate and extra re-renders.

AI-written summary · about

  1. 0:00Start
  2. 8:42Function Expressions vs. Declarations
  3. 12:10Named Function Expressions
  4. 17:19Object Shorthand Notation
  5. 28:10Class Field Declarations (Stage 3)
  6. 38:27The Proper Way
  7. 52:00Class Field Arrow Functions and React
~/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.