math.floor in javascript code example
Example 1: math.floor js
console.log(Math.floor(5.95));
console.log(Math.floor(5.05));
console.log(Math.floor(5));
console.log(Math.floor(-5.05));
Example 2: ~~ in javascript
~~ used to convert some types to int (32 bit int)
Example 3: math.max in javascript
Math.max() function returns the largest of the zero or more numbers given as input parameters.
Math.max(1,10,100);
Example 4: javascript round down
Math.floor(x);
Example 5: array.unshift in javascript
const array1 = [1, 2, 3];
console.log(array1.unshift(4, 5));
console.log(array1);
Example 6: math.round in javascript
let xo =7.45;
xo = Math.round(xo);