revision:
constructor() : returns the function that created this object's instance. By default this is the Number object.
toExponential() : forces a number to display in exponential notation, even if the number is in the range in which JavaScript normally uses standard notation.
toFixed() : formats a number with a specific number of digits to the right of the decimal.
toLocaleString() : returns a string value version of the current number in a format that may vary according to a browser's locale settings.
toPrecision() : defines how many total digits (including digits to the left and right of the decimal) to display of a number.
toString() : returns the string representation of the number's value.
valueOf() : returns the number's value.
isFinite() : determines whether the passed number is a finite number or not.
isInteger() : determines whether the number passed on as a parameter is an integer or not.
isNaN() : returns true is the number equal to NaN and false if otherwise.
isSafeInteger() : checks whether the number passes in a parameter is a safe integer. A safe integer consists of all integers from -(253–1) to 253–1 (+/-9007199254740991)
parseFloat() : parses the string and returns the very first number it finds.
parseInt() : returns a string that represents the number we passed to it in exponential aka scientific notation.
<div> <p id="numbers1"></p> <p id="numbers2"></p> <p id="numbers3"></p> <p id="numbers4"></p> <p id="numbers5"></p> <p id="numbers6"></p> <p id="numbers7"></p> <p id="numbers8"></p> <p id="numbers9"></p> <p id="numbers10"></p> <p id="numbers11"></p> <p id="numbers12"></p> <p id="numbers13"></p> <p id="numbers14"></p> <p id="numbers15"></p> <p id="numbers16"></p> <p id="numbers17"></p> <p id="numbers18"></p> <p id="numbers19"></p> <p id="numbers20"></p> <p id="numbers21"></p> <p id="numbers22"></p> </div> <script> var x = 9.656; var newX = x.toFixed(0); document.getElementById("numbers1").innerHTML = "toFixed(0) : " + newX; var newX = x.toFixed(2); document.getElementById("numbers2").innerHTML = "toFixed(2) : " + newX; var newX = x.toFixed(4); document.getElementById("numbers3").innerHTML = "toFixed(4) : " + newX; var newX = x.toFixed(6); document.getElementById("numbers4").innerHTML = "toFixed(6) : " + newX; document.getElementById("numbers5").innerHTML = "toFixed()) : " + (typeof(newX)) var x = 9.656; var newX = x.toPrecision(2); document.getElementById("numbers6").innerHTML = "toPrecision(2) : " + newX; var newX = x.toPrecision(4); document.getElementById("numbers7").innerHTML = "toPrecision(4) : " + newX; var newX = x.toPrecision(6); document.getElementById("numbers8").innerHTML = "toPrecision(6) : " + newX; document.getElementById("numbers9").innerHTML = "toPrecision() : " + (typeof(newX)); function addition(r) { return parseFloat(r) * 2.0; } console.log(addition(2)) document.getElementById("numbers10").innerHTML = "parseFloat(2) : " + addition(2); console.log(addition("2")) document.getElementById("numbers11").innerHTML = "parseFloat('2') : " + addition("2"); console.log(addition("3.3")) document.getElementById("numbers12").innerHTML = "parseFloat('3.3') : " + addition("3.3"); var x = true; console.log(Number(x)) document.getElementById("numbers13").innerHTML = "Number(x) : " + Number(x); var x = false; document.getElementById("numbers14").innerHTML = "Number(x) : " + Number(x); var x = "999"; document.getElementById("numbers15").innerHTML = "Number('999') : " + Number('999'); function additionA(r) { return parseInt(r) * 2.0; } console.log(additionA(2)) document.getElementById("numbers16").innerHTML = "parseInt(2) : " + additionA(2); console.log(additionA("2")) document.getElementById("numbers17").innerHTML = "parseInt('2') : " + additionA("2"); console.log(additionA("3.3")) document.getElementById("numbers18").innerHTML = "parseInt('3.3') : " + additionA("3.3"); const isFinite = Number.isFinite(3); document.getElementById("numbers19").innerHTML = "isFinite(3) : " + isFinite; const isInteger = Number.isInteger(3.3); document.getElementById("numbers20").innerHTML = "isInteger(3.3) : " + isInteger; const isNaN = Number.isNaN(100); document.getElementById("numbers21").innerHTML = "isNaN(100) : " + isNaN; const isSafeInteger = Number.isSafeInteger(100); document.getElementById("numbers22").innerHTML = "isSafeInteger(100) : " + isSafeInteger; </script>