mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-19 13:01:37 +02:00
add doc
This commit is contained in:
16
docs/lib2x-sum.md
Normal file
16
docs/lib2x-sum.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# sum
|
||||||
|
|
||||||
|
Use `+` to sum up all elements in a list.
|
||||||
|
|
||||||
|
**Since:** 2.4
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
- `lt` : a list of elements that can be applied by `+`.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
use <util/sum.scad>;
|
||||||
|
|
||||||
|
assert(sum([1, 2, 3, 4, 5]) == 15);
|
||||||
|
assert(sum([[1, 2, 3], [4, 5, 6]]) == [5, 7, 9]);
|
Reference in New Issue
Block a user