Adds the indicated numbers.
Example: Arrays in Origami (and JavaScript) use zero-based indices. If you want to add 1 to these indices to create a numbered list of strings:
// sections.ori
// Return a numbered list of sections
map(
["Introduction", "Basic Operations", "Advanced Operations", "Conclusion"]
(section, index) => `${ add(index, 1) }. ${ section }`
)
This outputs:
$ ori sections.ori/
- 1. Introduction
- 2. Basic Operations
- 3. Advanced Operations
- 4. Conclusion