mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-09-01 18:54:39 +02:00
add some
This commit is contained in:
17
docs/lib3x-some.md
Normal file
17
docs/lib3x-some.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# some
|
||||
|
||||
The `some` function tests whether at least one element in the list passes the test implemented by the provided function.
|
||||
|
||||
**Since:** 3.0
|
||||
|
||||
## Parameters
|
||||
|
||||
- `lt` : the list.
|
||||
- `test` : a test function that accepts an element and returns `true` or `false`.
|
||||
|
||||
## Examples
|
||||
|
||||
use <util/some.scad>;
|
||||
|
||||
isOdd = function(elem) elem % 2 == 1;
|
||||
assert(some([1, 30, 39, 29, 10, 13], isOdd));
|
Reference in New Issue
Block a user