You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionOP_plus_1(op1,op2){returnop1.concat(op2);}functionOP_plus_2(op1,op2){returnop1.concat(op2.toString());}functionOP_plus_3(op1,op2){returnOP_plus_2(op2,op1);}constfoo=OP_plus_1("123","456");constbar=OP_plus_2("123",456);constbaz=OP_plus_3(123,"456");functionOP_plus_0$1(op1,op2){// compiled result might change because of default function namereturnop1-op2;}constbazz=OP_plus_0$1(123,456);
The text was updated successfully, but these errors were encountered:
What?
Operator overloading which extends more usage of operator
Why?
Methods and functions can be overloaded, why not also for operators.
How?
Important rules: Operators which forbidden to overload/override are
=
,=>
and|>
(see #67 )Compiled Result
The text was updated successfully, but these errors were encountered: