3 ms·
Really makes me wish you could invoke instance methods on numbers (ala 5.amIFive())
by dclowd9901 12y ago
Really makes me wish you could invoke instance methods on numbers (ala 5.amIFive())
- Softcadbury 12y agoYou can :) Number.prototype.amIFive = function(){ return this.valueOf() == 5; } 5..amIFive();
- dclowd9901 12y agoAh, so you have to have two dots... I suppose the first one denotes the floating point value, and the second denotes the prototype accessor. Very clever.
- phpnode 12y ago(5).amIFive();