Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     function higher(table, min) {
  2.         let newTable = [];
  3.  
  4.         for (let i = 0; i < table.length; i++) {
  5.             if (table[i] > min) {
  6.                 newTable.push(table[i]);
  7.             }
  8.         }
  9.         return newTable;
  10.     };
  11.  
  12. testTable1 = [10, 15, 20, 25, 30];
  13. testTable2 = [5, 20, 30, 40];
  14. testTable3 = [12, 13, 14, 15, 16, 17];
  15.  
  16. console.log(higher(testTable1, 15));
  17. console.log(higher(testTable2, 21));
  18. console.log(higher(testTable2, 13));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement