Member-only story
‘A new array slicing representation in JavaScript — array \[start: top: step\]’
4 min readOct 27, 2024
Using this new slice representation, we will no longer write the followingslice()
code:
But you can write code like this:
This writing style is not only more concise and readable, but also more intuitive.
Even better, we don’t have to wait for its official release — we can use it now. You can expand it byArray
Class to implement this function:
Process unspecified end index
If we omit the second digit (i.eend
Will the array be sliced to the last element (parameter)?
It wouldn’t do that?