All syntax guides
Short, practical guides on programming syntax, language fundamentals, and the tools developers reach for every day.
3,965 guides across 14 topics
Topics
Popular guides
Most readLatest guides
Page 34 of 397TypeScript Mapped Types: Syntax, Key Remapping with as, and Modifiers
How mapped types iterate over keys, add and remove readonly and optional modifiers, and use the as clause to rename keys or drop properties entirely with never.
TypeScript unknown vs any: Type Safety, Type Guards, and Best Practices
Why any contaminates every caller while unknown forces the check at the boundary, with validation functions, generic inference traps, and the few places any is honestly correct.
TypeScript keyof and typeof: Object Type Queries and Property Keys
The difference between the two type queries, why keyof typeof collapses to string without literal types, and how K extends keyof T keeps a key and its value type in correspondence.
TypeScript infer Keyword: Conditional Types, ReturnType, and Unwrapping
How infer binds a type inside a conditional type, why distribution over unions changes results, and how ReturnType, Parameters, and recursive unwrapping types are actually built.
TypeScript as const: Const Assertions, Readonly Tuples, and Literal Types
What as const actually changes in inference, why object properties widen without it, and how readonly tuples, derived unions, and satisfies combine in real config and route tables.
Go Structs and Pointers: Value vs Pointer Receivers, Embedding, and Memory
Value and pointer receivers, shallow copies, addressability, embedding, and struct layout: the rules that decide when a method mutates, when a copy diverges, and why field order changes size.
Go Error Handling: errors.Is, errors.As, Sentinel Errors, and Custom Types
errors.Is and errors.As explained through the wrapping that makes them necessary: %w chains, multiple wrapped errors, custom Is methods, and the pointer rules that make As panic.
Go Interfaces: Implicit Implementation, Type Assertions, and Type Switches
Implicit interface satisfaction in Go: method sets and receiver kinds, type assertions versus type switches, the typed-nil interface, and the compile errors that name the missing method.
TypeScript Decorators: Stage 3 Syntax, Method Decorators, and Metadata
The standard decorator pipeline since TypeScript 5.0: the value and context signature for methods, fields, and accessors, addInitializer ordering, Symbol.metadata, and where it diverges from experimentalDecorators.
TypeScript Template Literal Types: Syntax, String Manipulation, and Patterns
Template literal types as patterns over string types: union cross products, the four intrinsic case types, key remapping with as, infer-based splitting, and the depth limit that ends recursive types.