I once put together a list of legal Python slices: for example -
variable variable[1:3] variable[::-1] variable[:]
And so on.
Is there something comparable in JS? I know we can access indexes such as array and so on, but where can I get all the legal expressions? Obviously, the exact expression for something like Python’s variable[::-1] will be different in JS.
Specifically, I’d like to access ALL the elements/indices of an array or subarray. Is that possible without getting into .length expressions for arrays you might not know the length of?