Why the Math object in JavaScript is useful

Video Player is loading.
Current Time 0:00
Duration -:-
Loaded: 0%
Stream Type LIVE
Remaining Time -:-
 
1x
8 Views
Published
// Math = built-in object that provides a
// collection of properties and methods

let x = 3;
let y = 2;
let z = 1;

//console.log(Math.PI);
//console.log(Math.E);

//z = Math.round(x);
//z = Math.floor(x);
//z = Math.ceil(x);
//z = Math.trunc(x);
//z = Math.pow(x, y);
//z = Math.sqrt(x);
//z = Math.log(x);
//z = Math.sin(x);
//z = Math.cos(x);
//z = Math.tan(x);
//z = Math.abs(x);
//z = Math.sign(x);
let max = Math.max(x, y, z);
let min = Math.min(x, y, z);

console.log(min);
Category
Bro Code
Tags
javascript, javascript tutorial, javascript full course
Show more
Be the first to comment