Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log(Math.pow(2, 3)); // 8
- console.log(Math.cos(Math.PI / 2)); // almost 0
- console.log(Math.random()); // a random number
- console.log(Math.min(1, 5)); // 1
- console.log(Math.max(2, 3)); // 3
- let myMath = {
- min: function(a, b) {
- if(a > b) return b;
- return a;
- }
- };
- console.log(myMath.min(1, 5)); // 1
- console.log(Math.min(5, 4, 3)); // 3
- console.log(myMath.min(5, 4, 3)); // 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement