2 ms·
Pipe "operator" for the rest of us: Object.prototype.pipe = function(fn) { return fn(this) } 'hello'.pipe(upper).pipe(ex('!!!')) Or code golf version
by mlajtos 1y ago
Pipe "operator" for the rest of us:
Object.prototype.pipe = function(fn) { return fn(this) }
'hello'.pipe(upper).pipe(ex('!!!'))
Or code golf version:
Object.prototype.P=function(...F){return F.reduce((v,f)=>f(v),this)}
'hello'.P(upper,ex('!!!'))