Facebook
From amir, 1 Month ago, written in JavaScript.
Embed
Download Paste or View Raw
Hits: 136
  1. function compareNumbers(arr) {
  2.  
  3.     let comparisonResult = "";
  4.     if (arr[0] > arr[1]) {
  5.         comparisonResult = "greater";
  6.     } else if (arr[0] < arr[1]) {
  7.          comparis
  8.     } else {
  9.          comparis
  10.     }
  11.  
  12.      if (comparis "equal") {
  13.         return "Both numbers are equal.";
  14.     }
  15.  
  16.     return `${arr[0]} is ${comparisonResult} than ${arr[1]}`;
  17. }
  18.  
  19.  
  20.