1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-07-31 20:10:36 +02:00

add count

This commit is contained in:
Justin Lin
2022-05-25 09:32:36 +08:00
parent 9ce272b434
commit 27536f28f6
3 changed files with 26 additions and 1 deletions

15
docs/lib3x-count.md Normal file
View File

@@ -0,0 +1,15 @@
# count
Returns the number of times `test` return `true` in the list.
**Since:** 3.3
## Parameters
- `lt` : The list.
- `test` : A testing function.
## Examples
points = [[7, 2, 2], [1, 1, 2], [3, 4, 2], [3, 4, 2], [1, 2, 3]];
assert(count(points, function(p) norm(p) > 5) == 3);