4 ms·
I wish javascript could handle operator overload. not only basic operator, also any custom. something like: objectClass.prototype.operator like = function(a,b)
by wdiamond 9y ago
I wish javascript could handle operator overload. not only basic operator, also any custom.
something like:
objectClass.prototype.operator like = function(a,b) {...}
objectClass3 = objectClass1 like objectClass2;
Object.defineOperator(objectClass.prototype,"like",{
priority: 10,
type: "binary",
callback : function(a,b) { ... }
});