Preview:
///////////////////// number  in javascript //////////////

const score = new Number(400)
console.log(score); ///[Number: 400]

const score2 =500
console.log(score2); ///500

console.log(score2.toString().length);//3
console.log(score2.toFixed(2));  ///500.0
 
const othernumber = 23.9898
console.log(othernumber.toPrecision(3));///precise value (24.0)


const hundreds = 100000
console.log(hundreds.toLocaleString('en-IN')); /// comammas in value in indian number system (output =  1,00,000)



//////////////////////////*********MATHS IN JS *****************/////////////////

console.log(Math); 
console.log(Math.abs(-4));/// it works like modulus convert all in +ve 
console.log(Math.round(4.6));/// roundoff  (5)
console.log(Math.ceil(4.6)); /// roundoff at upper (5) 
console.log(Math.floor(4.6)); /// roundoff at lower (4)
console.log(Math.min(4,4 , 6, 1, 6));/// 1 
console.log(Math.max(4,4 , 6, 1, 6));/// 6

console.log(Math.random()); 
console.log((Math.random()*10) + 1);
console.log(Math.floor(Math.random()*10) + 1);

/////////******************* when limits are given *****////////////////
const min = 10
const max = 20
console.log(Math.floor(Math.random() * (max-min+1)) + min )


downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter