( note: you can view this message as a gist @
https://gist.github.com/kosich/375da99403c76bc75bbd )
Currently we can imitate Arrays only with objects, where we would
refer to a value at some position via referring to objects property (
with integer index being converted to a string )
```js
var
Proxies should be enough for this. Is there any reason not to use them?
On 09 Apr 2015, at 20:31, Kos Ddsky kos...@gmail.com wrote:
( note: you can view this message as a gist @
https://gist.github.com/kosich/375da99403c76bc75bbd
https://gist.github.com/kosich/375da99403c76bc75bbd )
On Apr 9, 2015, at 2:37 PM, Jordan Harband ljh...@gmail.com wrote:
One advantage of this approach is that more spec magic can be implemented
in terms of the language - it would also make subclassed arrays more
versatile instead of having to always be a Proxy.
see
One advantage of this approach is that more spec magic can be implemented
in terms of the language - it would also make subclassed arrays more
versatile instead of having to always be a Proxy.
On Thu, Apr 9, 2015 at 11:35 AM, Axel Rauschmayer a...@rauschma.de wrote:
Proxies should be enough for
1. one will have to provide access to all `Array.prototype.methods`
2. proxies will be slower
3. bad readability
___
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss
An alternative that was discussed at one point was to invert this idea:
* Arrays get the methods that Maps already have: `get(index)` and `set(index,
value)`. Advantage: one could support negative indices. That is, the following
two expressions would be equivalent.
```js
arr.get(-1)
6 matches
Mail list logo