2 ms·
Your first example is just as functional as your second. And, quite possibly, better style. But your overall point is fair. A function, once composed, curried
by garethrowlands 4y ago
Your first example is just as functional as your second. And, quite possibly, better style.
But your overall point is fair. A function, once composed, curried or having captured data, is very much like an object. Indeed its representation in memory is likely very similar to an object (mostly functional languages) or actually identical (Java). Your debugger won’t show the data in such a function but it’s happy to show the data in an object. That’s a big advantage of objects over functions. Hopefully debuggers will get better at this eventually.