nowfound

Life & fun · December 16, 2011

multimethod.js - a Clojure-inspired multimethod library for JavaScript

## What is a multimethod?

multimethod.js - a Clojure-inspired multimethod library for JavaScript launched on December 16, 2011 with 49 votes, #20 of 254 launches that month and more than 90% of that year's launches. The site was still online in September 2026, 14 years on.

Visit krisjordan.com ↗Alternativestop 8% of December 2011

In plain words

multimethod.js is a JavaScript library that implements Clojure-style multimethods, a functional programming approach to polymorphism. It allows developers to dynamically dispatch function calls based on custom logic rather than relying on traditional prototype-based inheritance. The library provides an alternative control structure for building flexible, polymorphic functions. It is available on npm and GitHub under an MIT license.

written from the facts on this page · September 2026

From the sources

The quickest way to understand is by looking at a simple, familiar example implemented with a multimethod. So let's write a recursive Fibonacci function. Multimethods are a functional programming "control structure" enabling you to dynamically build-up and manipulate the dispatching behavior of a polymorphic function. Inspired by Clojure's multimethods , multimethod.js provides a functional alternative to classical, prototype based polymorphism. The multimethod.js library is MIT licensed, is found on GitHub and npm with npm install multimethod, and its annotated source code is available here. Let's use the node.js REPL to build a few multimethods and see what they are capable of doing. In…from krisjordan.com

Does a similar job

all alternatives →

More life & fun this month

the category →

Source: Show HN post ↗

Launched alongside, December 2011

the whole month →