Tab Atkins Jr. (2014-10-07T17:01:15.000Z)
On Sat, Oct 4, 2014 at 10:03 PM, Dmitry Soshnikov
<dmitry.soshnikov at gmail.com> wrote:
> This case I'd probably make as `Map#mapWithKey`, however there other
> questions arise like, should the returned pair replace the existing, or
> create a new one, if the key is different?
>
> ```
> ({a => 10}).mapWithKey((k, v) => ['b', 20]); // {b => 20} or {a => 20, b =>
> 20} ?
> ```
>
> But this is for further discussion.

Mapping produces a new object, so the answer to that is luckily trivial.

~TJ
forbes at lindesay.co.uk (2016-02-01T17:04:13.323Z)
> Should the returned pair replace the existing, or create a new one, if the key is different?

Mapping produces a new object, so the answer to that is luckily trivial.