Stage 3 Proposal: Array.prototype.at
1–10 of 153 posts
Re: Stage 3 Proposal: Array.prototype.at
#2Re: Stage 3 Proposal: Array.prototype.at
#3Am I reading this correctly — it's an alias for arr[i] and str[i]? I know languages like Ruby have arr.at(i), but why?
Re: Stage 3 Proposal: Array.prototype.at
#4Am I reading this correctly — it's an alias for arr[i] and str[i]? I know languages like Ruby have arr.at(i), but why?
Re: Stage 3 Proposal: Array.prototype.at
#5Am I reading this correctly — it's an alias for arr[i] and str[i]? I know languages like Ruby have arr.at(i), but why?
Re: Stage 3 Proposal: Array.prototype.at
#6Am I reading this correctly — it's an alias for arr[i] and str[i]? I know languages like Ruby have arr.at(i), but why?
Re: Stage 3 Proposal: Array.prototype.at
#7Am I reading this correctly — it's an alias for arr[i] and str[i]? I know languages like Ruby have arr.at(i), but why?
I've lost count on how many times I've wrote this function manually.
Re: Stage 3 Proposal: Array.prototype.at
#8Am I reading this correctly — it's an alias for arr[i] and str[i]? I know languages like Ruby have arr.at(i), but why?
A quick read suggests that it adds negative indexing from the end of the array.
Re: Stage 3 Proposal: Array.prototype.at
#9Re: Stage 3 Proposal: Array.prototype.at
#10So instead of fixing the language and allow to use array[-1], they add an other way to access array element. This is why I don't like JavaScript, instead of fixing feature, they add new feature to fix previous feature.
array[-1] = “foo”
This already works in JS but doesn’t do what you expect and just assigns the property.