Converts the object into a primitive
The string to use for the default toString
function
Converts the radians into degrees
the converted degrees value
Converts the primitive into it's JSON representation
the object to serialize with JSON.stringify
Retrieves the actual value of the number
Represents an angle
const radians = new Radians(2 * Math.PI); radians.toString(); // -> '2π rad' `${radians}`; // -> '6.283' +radians; // -> 6.283 radians.value; // -> 6.283
const previous = new Radians(2 * Math.PI); const radians = new Radians(previous); radians.toString(); // -> '2π rad'
const radians = new Radians(Math.PI); const degrees = radians.toDegrees(); degrees.toString(); // -> '180°'