News for hackers. Stuff that matters.
Re:Ask HN: What would you change about JavaScript if you could? by wdiamond on Thursday September 07, 2017 @11:11PM (#15197651)
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) { ... } });

There are no comments on this comment yet.