codingtcher.com
Theme Night
Home
Login

Javascript Numbers

Home » Javascript » Js Numbers

JavaScript Number

const number1 = 3;
const number2 = 3.433;
const number3 = 3e5 // 3 * 10^5

JavaScript Numbers

let x = 3.14;    // A number with decimals
let y = 3;       // A number without decimals

javascript two character integer

var myNumber = 7;
var formattedNumber = ("0" + myNumber).slice(-2);
console.log(formattedNumber);
Source: stackoverflow.com

javascript Number() Method

Number(true);
Number(false);
Number("10");
Number("  10");
Number("10  ");
Number(" 10  ");
Number("10.33");
Number("10,33");
Number("10 33");
Number("John");

Javascript Related Post