1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 22:28:16 +01:00
dotSCAD/docs/lib3x-find_index.md

16 lines
348 B
Markdown
Raw Normal View History

2021-03-07 09:42:54 +08:00
# find_index
Returns the index of the first element in the list that satisfies the testing function. If no element passed the test, it returns -1.
**Since:** 3.0
## Parameters
- `lt` : The list.
- `test` : the testing function.
## Examples
2022-06-06 13:11:46 +08:00
use <util/find_index.scad>
2021-03-07 09:42:54 +08:00
assert(find_index([10, 20, 30, 40], function(e) e > 10) == 1);