2 ms·
It is what it is, and what it is in JavaScript is this: Object.prototype.pipeTo = function (functor) { return functor (this); }; function inc (inp
by AdieuToLogic 8y ago
It is what it is, and what it is in JavaScript is this:
Object.prototype.pipeTo = function (functor) {
return functor (this);
};
function inc (input) { return input + 1; }
// this will write out "2" to the console log
new Number (1).pipeTo (inc).pipeTo (console.log);
HTH