Skip to content

Functions & Parameters

Programming

Understand parameters: defaults, rest/spread, named args, higher-order functions.

Official Site
01

Overview

Functions are primary abstraction. Patterns: defaults, rest params, named args via destructuring. Pure functions are easier to test.

bash
function f(url,{method="GET"}={}){}
const add=a=>b=>a+b; add(5)(3);
02

Best Practices

Limit params to 3-4; use options object. Use defaults vs null checks. Prefer pure functions. Keep under 20 lines.

Ready to try Functions & Parameters?

Visit the official site for the latest version and full documentation.

Visit Functions & Parameters