+1

---
R. Mark Volkmann
Object Computing, Inc.

> On Jan 18, 2015, at 6:28 AM, Axel Rauschmayer <a...@rauschma.de> wrote:
> 
> Currently the keys of the entries returned by `Set.prototype.entries()` are 
> the same as the values:
> 
> ```js
> let set = new Set(['a', 'b']);
> 
> let pairs = [...set.entries()];
> console.log(JSON.stringify(pairs)); // [["a","a"],["b","b”]]
> ```
> 
> Given that sets are ordered, I’d use the “position” of an entry as the key: 
> [[0,"a"],[1,"b”]]
> 
> Rationale: First, having an indices as keys makes the entries more useful. 
> Second, destructuring already treats entries as if they had indices:
> 
> ```js
> let [x,y] = set; // x='a'; y='b’;
> ```
> 
> -- 
> Dr. Axel Rauschmayer
> a...@rauschma.de
> rauschma.de
> 
> 
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to