daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Generate {
  2.     static between(start, end) {
  3.         let numbers = [];
  4.         for (let i = start; i <= end; i++) {
  5.             numbers.push(i);
  6.         }
  7.         return numbers;
  8.     }
  9.  
  10.     static oddBetween(start, end) {
  11.         let numbers = [];
  12.         for (let i = start; i <= end; i++) {
  13.         if(i%2 == 1) {
  14.                numbers.push(i);
  15.             }
  16.         }
  17.         return numbers;
  18.     }
  19.  
  20.     static evenBetween(start, end) {
  21.         let numbers = [];
  22.         for (let i = start; i <= end; i++) {
  23.             if(i%2 == 0) {
  24.                numbers.push(i);
  25.             }
  26.         }
  27.         return numbers;
  28.     }
  29. }
RAW Paste Data
Top