I need to get a string representation of a function, with its corresponding values of arguments.
Imagine the following statement:
const r1 = (x) => abc(x, 2);
Executing r1.toString() would give a string "x => abc(x, 2)".
Now, imagine I modify the previous piece of code like this:
const create = y => (x => abc(x, y));
const r2 = create(2);
Although r1 and r2 are equivalent in terms of the execution (they will both call abc, passing 2 as the second argument), the string representation will be different. In fact, r2.toString() will now give "x => abc(x, y)".
How do I modify either the create function ro the r2.toString() to have the same output as r1.toString()?