1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
dotSCAD/docs/lib3x-swap.md

17 lines
267 B
Markdown
Raw Normal View History

2021-03-07 09:42:54 +08:00
# swap
Swaps two elements in a list.
**Since:** 3.0
## Parameters
- `lt` : The list.
2021-03-07 09:45:19 +08:00
- `i` : The index of one element.
2021-03-07 09:42:54 +08:00
- `j` : The index of the other element
## Examples
2022-06-06 13:11:46 +08:00
use <util/swap.scad>
2021-03-07 09:42:54 +08:00
assert(swap([10, 20, 30, 40], 1, 3) == [10, 40, 30, 20]);