.trim(idx1,idx2)
Description
Parameters
Usage On Arrays
log [1,2,3,4].trim(1, 3) // [1, 2, 3]log [1,2,3,4].trim(-2, -1) // [3, 4]log [1,2,3,4].trim(1, -2) // [1, 2, 3]Last updated
Slices the array from the start index to the end index.
start — the index to start from.
end — the index to end at.
log [1,2,3,4].trim(1, 3) // [1, 2, 3]log [1,2,3,4].trim(-2, -1) // [3, 4]log [1,2,3,4].trim(1, -2) // [1, 2, 3]Last updated