Math Functions

 console.log(Math.E);

console.log(Math.PI);

// MATH.ABS(n)
console.log(Math.abs(5));
console.log(Math.abs(-5));
console.log(Math.abs(-15));

// MATH.POW(a,b)
console.log(Math.pow(2, 4));
console.log(Math.pow(3, 3));

// MATH.FLOOR(n)
console.log(Math.floor(5.5));
console.log(Math.floor(5.999999999));
console.log(Math.floor(-5.5));

// MATH.CEIL(n)
console.log(Math.ceil(5.5));
console.log(Math.ceil(5.000011));
console.log(Math.ceil(-5.5));

// MATH.RANDOM()
console.log(Math.random());
console.log(Math.random());
console.log(Math.random());


Comments

Popular posts from this blog

Callback Hell

TODO list with DOM

Refactoring callback hell code