Prefer not to extend native types JS-0061
Anti-pattern
Minor
10 months ago2 years old
Number prototype is read only, properties should not be added
287
288    //-- Define degrees function
289    if (typeof Number.prototype.toDeg === "undefined") {
290      Number.prototype.toDeg = function () {291        return this * (180 / Math.PI);292      };293    }
294
295    //-- Define middle point function
Number prototype is read only, properties should not be added
280
281    //-- Define radius function
282    if (typeof Number.prototype.toRad === "undefined") {
283      Number.prototype.toRad = function () {284        return (this * Math.PI) / 180;285      };286    }
287
288    //-- Define degrees function