ecmascript-operator-overloading-proposal icon indicating copy to clipboard operation
ecmascript-operator-overloading-proposal copied to clipboard

A proposal for operator overloading in ECMAScript

Results 4 ecmascript-operator-overloading-proposal issues
Sort by recently updated
recently updated
newest added

Currently the proposal states that the methods that provide the operator behavior should be static. I understand that this is the convention in other languages that implement operator overloading such...

👋 I was ready to write this proposal myself, but here it is! Could you use a hand?

For example: ``` const oldAdd = Number[Symbol.operator('+')]; Number[Symbol.operator('+')] = (a, b) => { if (typeof a != "number" or typeof b != "number") { console.log("warning: types coercion has occurred in...

``` class Thinger {} let thingerA = new Thinger() console.log(thingerA + 1) // "[object Obejct1]" ```