This site is mobile accessible. Press the "Tap Here" button to use a smaller font-size.
Smartphone icons created by Freepik - Flaticon
The
method converts variables to numbers:
document.getElementById("demo").innerHTML = Number(true) + "<br>" + Number(false) + "<br>" + Number("10") + "<br>" + Number(" 10") + "<br>" + Number("10 ") + "<br>" + Number(" 10 ") + "<br>" + Number("10.33") + "<br>" + Number("10,33") + "<br>" + Number("10 33") + "<br>" + Number("John");
If the number cannot be converted,
(Not a Number) is returned.booleans - true booleans - false number NaN