This repository has been archived by the owner on Mar 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
A syntax approach (arr[^n] for arr[arr.length-n]) #28
Comments
Syntax seems like a pretty high cost for something that's only useful on arrays and arraylike objects. |
caub
changed the title
A syntax approach (arr[^n] for arr[arr.length-n])
A syntax approach (arr[^n] or arr[~n] for arr[arr.length-n])
Aug 30, 2019
We can't use |
Yes true, so we're left with |
caub
changed the title
A syntax approach (arr[^n] or arr[~n] for arr[arr.length-n])
A syntax approach (arr[^n] for arr[arr.length-n])
Oct 21, 2019
why not just use negative number |
@Fenzland because |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
arr[^1]
,arr[^2]
, etc.. orarr[~1]
if this symbol is chosen)Symbol.index
, I'm not sure it's needed, less spec additions is better)lastIndex
andlastItem
) and prototypes 'pollution', soa symtax approach is more future-proof in that aspect maybe?
The text was updated successfully, but these errors were encountered: