Concepts
Filter by language, difficulty, era.
<details> and <summary>
Disclosure, no JavaScript.
A native expand/collapse component with built-in keyboard support, screen-reader semantics, and almost zero CSS to style.
<progress> and <meter>
Two gauges, two jobs.
<progress> tracks how far a task has gotten; <meter> shows a measurement inside a known range β and both are native, accessible, and stylable without a single div.
Array.reduce patterns
One loop, any shape of answer.
reduce folds an array into a single value of any shape β a number, an object, a map β by threading an accumulator through every element; learn the handful of patterns and you stop reaching for manual loops.
CSS custom properties
Variables that live in the cascade.
Custom properties aren't preprocessor variables β they're real values in the DOM that inherit, cascade, and update live. Define once with --name, read with var().
CSS scroll snapping
Carousels and galleries that lock into place β no JavaScript.
Scroll snapping lets the browser settle a scroll container on tidy resting points. Declare the snap behaviour on the scroller, the alignment on each child, and panning glides to crisp stops instead of drifting mid-item.
Closures and the module pattern
Functions that remember.
A closure is a function bundled with the variables it was born in β the foundation of private state, factories, memoization, and the classic module pattern.
Collections essentials
The three workhorse collections β a growable list, a keyed dictionary, and a uniqueness-enforcing set β plus the collection-expression syntax that builds them all the same way.
List<T> grows on demand, Dictionary<K,V> maps keys to values with TryGetValue, and HashSet<T> keeps only distinct items β and [ ... ] collection expressions initialise any of them.
Conditional types and infer
Types that branch.
A conditional type is an if/else at the type level β T extends U ? X : Y β and infer lets you capture a piece of a matched type, which is how ReturnType, ElementType, and Flatten are all built.
Container Queries
Components that adapt to their container.
Media queries respond to the viewport. Container queries respond to whatever element you nominate as a container β so a card knows whether it's in a sidebar or a hero.
Destructuring
Unpack, in place.
Pull values out of objects and arrays directly into named bindings β with renames, defaults, nesting, and rest patterns layered on top.
Discriminated Unions
Tag your variants.
Give every variant in a union a unique literal "tag" property β and TypeScript will narrow on it for free, with exhaustiveness checking thrown in.
Error handling
Errors are values you return, check, and inspect β not exceptions you throw.
Go models failure with a returned error value; fmt.Errorf("...: %w", err) wraps it, and errors.Is/errors.As inspect the chain.
Flexbox essentials
One-dimensional layout, mastered.
Flexbox lays children out along a single axis and shares the leftover space between them. Once you can name the main axis, justify-content and align-items stop being a guessing game.
Fluid type with clamp()
One value that scales itself.
clamp(min, preferred, max) lets a font size grow with the viewport but never shrink below a floor or blow past a ceiling β no media-query breakpoints, no JavaScript.
Function overloads
Many faces, one body.
Overload signatures let one function advertise several distinct call shapes β different argument types mapping to different return types β backed by a single implementation signature that callers never see.
Functional JavaScript
Data in, data out.
OOP has its place, but functional patterns β pure functions, immutability, composition β produce code that's easier to test and easier to reason about.
Generators and iterators
Sequences, paused on demand.
A generator is a function you can pause and resume. It hands back values one at a time, only computing the next when you ask β which makes lazy and even infinite sequences trivial.
Generics (type parameters)
Write one function that works for many types, checked at compile time.
Go 1.18 added type parameters and constraints β generic Map/Filter/Reduce, comparable lookups, and reusable containers, all statically type-safe with zero reflection.
Generics, the basics
One function, every type.
Generics let a function, class, or type take a type as a parameter β so you write identity<T> once and it stays type-safe for strings, numbers, and your own interfaces alike.
Grid Template Areas
Layouts as ASCII art.
Name regions of a grid in plain English, then assign children to them. The CSS reads like the layout it produces.
Interfaces and methods
An interface is a set of method signatures; any type with those methods satisfies it β no implements keyword.
Go interfaces are satisfied implicitly: define Area() float64 on a type and it *is* a Shape, enabling polymorphism, fmt.Stringer, and switch v := x.(type) dispatch.
Intl.NumberFormat
Localised, by the runtime.
Stop hand-rolling currency strings and percentage formatters. The browser ships a full ICU-backed localisation library.
Iterators with yield
An iterator method that hands back one value at a time with yield return, building a lazy IEnumerable<T> the runtime resumes on demand instead of materialising a list.
yield return produces the next element and parks the method until MoveNext asks again; yield break ends the sequence early, so a foreach can consume an infinite stream and stop after Take(n).
LINQ essentials
Query any sequence with the same handful of operators.
Where, Select, OrderBy, GroupBy β composable, lazy, and the same whether the source is a list, a file, or a database.