Advertisement
dhshin

practice_15

Jun 26th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. console.log(Math.pow(2, 3)); // 8
  2. console.log(Math.cos(Math.PI / 2)); // almost 0
  3.  
  4. console.log(Math.random()); // a random number
  5. console.log(Math.min(1, 5)); // 1
  6. console.log(Math.max(2, 3)); // 3
  7.  
  8.  
  9. let myMath = {
  10.   min: function(a, b) {
  11.     if(a > b) return b;
  12.     return a;
  13.   }
  14. };
  15.  
  16. console.log(myMath.min(1, 5)); // 1
  17.  
  18. console.log(Math.min(5, 4, 3)); // 3
  19. console.log(myMath.min(5, 4, 3)); // 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement