.trim(idx1,idx2)
Description
Slices the array from the start index to the end index.
Parameters
start — the index to start from.
end — the index to end at.
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
Was this helpful?