3 ms·
JavaScript already allows you to do something very similar to extension methods by extending prototypes. OTOH, a function accepting an object which implements
by patates 10y ago
JavaScript already allows you to do something very similar to extension methods by extending prototypes.
OTOH, a function accepting an object which implements a specific interface as a parameter will make your code much more easier to extend, instead of modifying the prototype of a concrete class.