I\'m practicing/studying both JavaScript and Python. I\'m wondering if Javascript has the equivalence to this type of coding.
I\'m basically trying to get an array
You could easily achieve this behavior using an application functor.
Array.prototype.ap = function(xs) { return this.reduce((acc, f) => acc.concat(xs.map(f)), []) } const result = [x => x +1].ap([2]) console.log(result)