Skip to content

Instantly share code, notes, and snippets.

View 0-80's full-sized avatar

James 0-80

View GitHub Profile
@0-80
0-80 / &:.js
Last active May 28, 2022 12:46
&:
const self = new Proxy({}, {
get: (_, prop) => (...args) => obj => obj[prop](...args)
})
console.log(['hello', 'world'].map(self.slice(1)))

🤔

I finally came across practical example of currying

classic example

the classic example of currying is

instead of

const add = (x, y, z) => x + y + z