Understanding Converge

I thought I had a reasonable handle on how converge works, but I've been staring at this problem and its criptic (to me), error message for a bit and nothing seems to be jumping out at me.

Minimal Example

const first = pipe(   
  inc,
  num => compose(multiply(num), multiply(num))
)(9)(1);
console.log("First: ", first);

const second = pipe(
  inc,
  converge(compose, [multiply, multiply])
)(9)(1);
console.log("Second: ", second);

Output:

First: 100
Error: First argument to _arity must be a non-negative integer no greater than ten


Read more here: https://stackoverflow.com/questions/66339685/understanding-converge

Content Attribution

This content was originally published by Mrk Sef at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: