Module 5 · Functions: Declarations, Arrows, Defaults and Rest
When to Use Which: Declaration or Arrow, a Default or a Check, Recursion or a Loop
Free with an accountReading
Zara reviews Bob's pull request, the change he asks the team to merge. Half his functions are declarations, the other half are arrows, and nothing seems to decide which. "Does it matter?" she writes. Bob says it is only style. He is right about most of it, and wrong in exactly two places. This lesson finds both, then makes the other choices a function asks you to make.
Checking what this lesson needs for you…
What is inside When to Use Which: Declaration or Arrow, a Default or a Check, Recursion or a Loop
- One rule for the spelling
- The first place it matters: calling above the line
- The three spellings on one chart
- Choosing with a flowchart
- A default, ?? or a check
- Rest parameters or one array
- When code should become a function
- Recursion or a loop