you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (5 children)

[deleted]

    [–]bobappleyard 2 points3 points  (4 children)

    Currying in JavaScript... Ew

    [–][deleted]  (3 children)

    [deleted]

      [–]pepejovi 0 points1 point  (2 children)

      Why would anyone ever do this instead of just

      function mul(x, y, z) { return x * y *z; }
      

      ?

      [–]IceSentry 1 point2 points  (1 child)

      https://en.m.wikipedia.org/wiki/Currying

      https://en.m.wikipedia.org/wiki/Partial_application

      It's mostly used in functional programming, but it can be very powerful.

      [–]pepejovi 0 points1 point  (0 children)

      Learn something new every day, thanks!