Why not embrace `Array.prototype.reduce` instead of trying to abstract it
away?
```js
const identity = a => a
const toObject = (fk, fv = identity) =>
(acc, curr) => (acc[fk(curr)] = fv(curr), acc)
const arr = [['a', '1'], ['b', '2'], ['c', '3']]
arr.map(a => [a[0], parseInt(a[1], 10)])
.
Mixing the semantics of a unary operator with a binary operator seems...
not ideal.
On Tue, Jul 10, 2018 at 7:23 AM kai zhu wrote:
> -1
>
> this feature mostly cross-cuts "!obj.hasOwnProperty('foo')". the only
> semantic-difference is "in" will check prototype-chain as jordan
> pointed out (and
Good point.
On Wed, Jul 11, 2018 at 10:02 AM Guylian Cox wrote:
> It isn't that different from mixing == with ! to get !=
>
> Le mer. 11 juil. 2018 à 15:51, Barret Furton a
> écrit :
>
>> Mixing the semantics of a unary operator with a binary operator seems...
>&
I wonder if this could be accomplished with a proxy object instead of new
syntax.
```js
const o = new Proxy(/* some implementation */);
const pickName = o.name;
pickName({ name: "Bob" }); // "Bob"
// maybe this could work too with a recursive proxy
// with handlers for access and invocation
con
4 matches
Mail list logo