Alex Vincent (2014-06-10T01:09:14.000Z)
domenic at domenicdenicola.com (2014-06-12T22:38:03.221Z)
I like the idea of value types, but I wonder if, for terminating decimal numbers, the .valueOf() method from Object.prototype might be sufficient for many operations. Example: ```js function SmallDecimal(k) { this.__value__ = k; } SmallDecimal.prototype.valueOf = function() { return this.__value__.toString(10); } var x = new SmallDecimal(2); var y = new SmallDecimal(3); [x < y, x > y, x == y, x <= y, x >= y, x != y] /* true,false,false,true,false,true */ ``` I still want to see value types go forward: in the above example, x + y would result in "23", where x - y === -1. Perhaps .valueOf could be used in testing simple value types implementations.