Advertisement
magrega

Untitled

May 6th, 2022
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // Место для второй задачи
  2. function findMaxNumber(num1, num2, num3, num4) {
  3.  
  4. if (typeof num1 === 'string' || typeof num2 === 'string' || typeof num3 === 'string' || typeof num4 === 'string') {
  5. return 0;
  6. }
  7. else if (arguments.length < 4) {
  8. return 0;
  9. }
  10.  
  11.  
  12. const nums = [num1, num2, num3, num4];
  13.  
  14. // nums.sort(function (a, b) {
  15. // return a - b;
  16. // });
  17.  
  18.  
  19. return nums[3];
  20.  
  21. }
  22.  
  23.  
  24.  
  25. console.log(findMaxNumber(2, 3, 5, 7));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement