GenericFunction(); plus.addMethod([num, str], function (op1, op2) { ... }); plus.addMethod([str, num], function (op1, op2) { ... }); plus(3, 'abc') plus('abc', 3) (In languages with multiple dispatch, the cases are called methods.) Axel Rauschmayer (2ality.com) Multiple dispatch 2013-11-11 5 / 9