(Map|Set|WeakMap)#set() returns `this` ?
waldron.rick at gmail.com
Wed Dec 5 12:43:11 PST 2012
On Wed, Dec 5, 2012 at 3:26 PM, Domenic Denicola <
domenic at domenicdenicola.com> wrote:
> Readability or library preference aside, I still think it's bizarre that
> map.set(key, val)
> is analogous to
> (dict[key] = val, dict)
> and not to
> dict[key] = val
> When I'm using a fluent library like jQuery or a configuration DSL like
> those in the npm packages surveyed, I can see the attraction of chaining.
> But when I am using a basic primitive of the language, I expect uniformity
> across primitives.
This argument won't hold when the language doesn't make any such
"uniformity" promises, eg.
array.push(val); // new length
array[ array.length - 1 ] = val; // val
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss