From 37e6d3d810808be821162c44335a5e391c5fae07 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sat, 23 May 2020 11:20:33 +0800 Subject: [PATCH] add doc --- docs/lib2x-sum.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/lib2x-sum.md diff --git a/docs/lib2x-sum.md b/docs/lib2x-sum.md new file mode 100644 index 00000000..71323f08 --- /dev/null +++ b/docs/lib2x-sum.md @@ -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 ; + + assert(sum([1, 2, 3, 4, 5]) == 15); + assert(sum([[1, 2, 3], [4, 5, 6]]) == [5, 7, 9]);