-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnumsAndMaths.js
36 lines (23 loc) · 925 Bytes
/
numsAndMaths.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// const score=400 //implicitly define datatype(Number)
// const balance=new Number(100) //explicitly define datatype(Number)
// console.log(balance);
//-----------------Methods of Number----------------------------
// console.log(balance.valueOf());
// console.log(balance.toString().length);
// console.log(balance.toFixed(3));
// const otherNumber=123.8966
// console.log(otherNumber.toPrecision(3));
// const hundreds=10000000
// console.log(hundreds.toLocaleString('en-IN'));
//******************************Maths**********************************/
// console.log(Math);
// console.log(Math.abs(-4));
// console.log(Math.round(4.6));
// console.log(Math.ceil(4.2));
// console.log(Math.min(4,3,2,66,24));
// console.log(Math.max(4,3,2,66,24));
// console.log((Math.random()*10)+1);
const min=10
const max=20
//------Learn this formula----------------
console.log(Math.floor(Math.random()*(max-min+1))+min);