the monorail monad. every time you bind it logs that the shiny glaceon has gotten a little big larger

javascript 

class Monorail {
#value;
#size = 1;

constructor(value) {
this.#value = value;
}

bind(f) {
const newThis = f(this.#value);

if (newThis.#size < this.#size + 1) newThis.#size = this.#size + 1;
console.log(`the glaceon is now ${newThis.#size} meters tall`);
return newThis;
}
};

re: javascript 

@aescling using oop in javascript 🤮

Follow

re: javascript 

@aescling makes it better, but still not good enough

re: javascript 

@aescling but it's the sonic movie

Sign in to participate in the conversation
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.