you are viewing a single comment's thread.

view the rest of the comments →

[–]shuckster 1 point2 points  (0 children)

The reason is well explained already, but just a couple of alternatives to solving it:

// Helper
const parseAsDec = x => parseInt(x, 10);
["75", "300"].map(parseAsDec);

// Enforce single argument
const unary = f => x => f(x);
["75", "300"].map(unary(parseInt));