Skip to content

Polymorphism

Ben Christel edited this page Dec 21, 2020 · 1 revision

Polymorphism is often associated with ObjectOrientedProgramming, but Functions and Procedures can implement polymorphic interfaces too, e.g.

[1,2,3].map(double)
// => [2, 4, 6]

Here, double implements the role expected by map: a pure function of one argument.

Clone this wiki locally