kbo25

Awesome Numbers

Feb 5th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve (num, fav) {
  2.   let aCount = 0;
  3.   if (num % 2 !== 0) {
  4.     aCount++;
  5.   }
  6.   if (num < 0) {
  7.     aCount++;
  8.   }
  9.   if (num % fav === 0) {
  10.     aCount++;
  11.   }
  12.  
  13.   switch (aCount) {
  14.     case 0:
  15.       console.log('boring');
  16.       break;
  17.     case 1:
  18.       console.log('awesome');
  19.       break;
  20.     case 2:
  21.       console.log('super awesome');
  22.       break;
  23.     case 3:
  24.       console.log('super special awesome');
  25.       break;
  26.     default:
  27.       break;
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment