The Decorator Pattern in JavaScript
Learn the Decorator pattern in JavaScript -- wrap functions and classes to add logging, caching, validation, and retry logic without modifying original code.
12 posts · page 1 of 1
Learn the Decorator pattern in JavaScript -- wrap functions and classes to add logging, caching, validation, and retry logic without modifying original code.
Understand how Python closures capture variables, the LEGB scope resolution rule, and common pitfalls like late binding in loops.
When to use stored procedures, when to use functions, and how transaction control, return values, and side effects differ across major databases.
Write C++ functions that pass data correctly: by value, by reference, by const reference, with overloading, default arguments, and clear ownership.
A practical guide to Rust functions — fn syntax, parameter types, return values, the difference between statements and expressions, the trailing-expression rule, and early returns.
A complete guide to Go functions — declarations, parameters, multiple and named returns, the error idiom that defines Go, variadic parameters, and functions as values.
A practical guide to arrow functions — concise syntax, implicit returns, and the lexical this that makes them perfect for callbacks but wrong for methods and constructors.
A practical guide to JavaScript functions — declarations vs expressions, hoisting, parameters and arguments, default and rest parameters, return values, and functions as first-class values.
A practical guide to Python lambda functions — syntax, use with sorted, map, and filter, common patterns, and the situations where a named def is the clearer choice.
A practical guide to Python function arguments — defaults, keyword arguments, *args, **kwargs, positional-only and keyword-only parameters, and the mutable default gotcha.
A practical guide to Python functions — defining with def, returning values, arguments and parameters, docstrings, and the habits that make functions worth reusing.
A practical, beginner-friendly guide to typing functions in TypeScript — parameter and return types, optional and default parameters, rest parameters, callbacks, and overloads.