Advertisement
Spocoman

02. Greater Number

Dec 10th, 2021 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function GreaterNumber(input) {
  2.     let firstNumber = parseInt(input[0]);
  3.     let secondNumber = parseInt(input[1]);
  4.  
  5.     if (firstNumber > secondNumber)
  6.         console.log(firstNumber);
  7.     else
  8.         console.log(secondNumber);
  9. }
  10.  
  11.  
  12. Второ решение:
  13.  
  14. function GreaterNumber(input) {
  15.  
  16.     if (parseInt(input[0]) > parseInt(input[1]))
  17.         console.log(input[0]);
  18.     else
  19.         console.log(input[1]);
  20. }
  21.  
  22.  
  23. Тарикатско решение:)
  24.  
  25. function GreaterNumber(input) {
  26.    
  27.     console.log(parseInt(input[0]) > parseInt(input[1])? input[0] : input[1]);    
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement