Skip to content

Instantly share code, notes, and snippets.

View jackyscript's full-sized avatar

dejafu jackyscript

  • Berlin
View GitHub Profile
@MeetMartin
MeetMartin / Monad.js
Last active April 22, 2024 06:33
JavaScript Monad in under 60 seconds.
// JavaScript functional programming
// Monad under 60 seconds
const Functor = {
of: value => ({
value: value,
inspect: () => console.log(`Functor(${value})`),
map: fn => Functor.of(fn(value))
})
};