Languages / JavaScript Core
Functions and Scope
Closures, `this`, callbacks, and common functional patterns.
Scope and closures
Lexical scope decides which bindings are visible where; closures keep outer variables alive after the outer function returns. If you know block scope from C#, Java, or Rust, JavaScript's var hoisting and function closures are the pieces that differ most.
The this keyword
this is not lexical like most variables—it is set when a function runs. Call site, method syntax, bind/call/apply, arrow functions, and classes each follow rules that differ from Python's self or Java's implicit receiver.
Higher-order functions and callbacks
Functions are first-class values: pass them as arguments, return them, store them in data structures. Array methods and async APIs build on that model— familiar if you have used map/filter in Python or streams in Java.
Functional patterns in JavaScript
IIFEs isolate scope before modules were universal; currying, compose, and memoize express reusable function plumbing. JavaScript is multi-paradigm—these patterns are idiomatic where they reduce noise, not mandatory style.