1Math.round(3.14159) // 3
2Math.round(3.5) // 4
3Math.floor(3.8) // 3
4Math.ceil(3.2) // 4
5
1+3.5 => +3.0
2-3.5 => -4.0
3
4+3.5 => +3.0 using Math.floor()
5-3.5 => -3.0 using Math.ceil()
1using Math.floor
2
3console.log(Math.floor(5.95));
4// expected output: 5
5
6console.log(Math.floor(5.05));
7// expected output: 5
8
9console.log(Math.floor(5));
10// expected output: 5
11
12console.log(Math.floor(-5.05));
13// expected output: -6
14