Array.prototype.remove(index) plz
-
-
This Tweet is unavailable.
-
Replying to @corinna_cohn @sebmck
Why's that useful vs [0]? Is the idea that it'd work on sparse arrays?
2 replies 0 retweets 2 likes -
Because its beautiful sugar, that just makes sense how to use. And yeah could work on sparse arrays. Same with .last. This is huge in langs like Ruby, and I've pushed for it for awhile.
3 replies 0 retweets 14 likes -
Sure, I'm just trying to figure out why the sugar is tasty. The case for .last is much more compelling, as arr[arr.length - 1] is gross. arr[0] seems ok in comparison.
4 replies 0 retweets 21 likes -
Readability. Descriptive. I think of the first time I jumped into Ruby, comparing arr[0] and arr.first I knew exactly what to expect from .first. 0 wasn't always clear right away.
4 replies 0 retweets 8 likes -
Really? But in many cases "first" wouldn't mean "1st", it'd mean "0th". Feels more ambiguous than [0].
3 replies 0 retweets 10 likes -
We need .zeroth for [0] and then .first can be [1]pic.twitter.com/qAj97RM898
2 replies 0 retweets 40 likes -
Let's just allow English-spelled numbers, then you can do arr[num`zero`]
3 replies 0 retweets 7 likes
Would arr[num`nought`] work? Or would it be the American spelling naught? So much bikeshed potential.
-
-
Bahaha don't forget num`zed`
1 reply 0 retweets 1 like - 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 