Assignability
falsandtru opened this issue · 4 comments
falsandtru commented
Does .at
method have ability to assign a new value like arr.at(-1) = 0
? Or can you enable arr.at[-1] = 0
?
ljharb commented
No, it doesn’t, and no, we can’t; JS doesn’t have “functions return assignable references” as a feature (imo, thankfully).
falsandtru commented
I think the expected feature is a readable and writable accessor. But this proposal doesn't aim at updating an element via negative index?
ljharb commented
Correct, it is only for reading the value.
falsandtru commented
I see, thanks.