AlfatArdiansa

Codewars w Sandhika 11

Oct 31st, 2020
648
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class SmallestIntegerFinder {
  2.   findSmallestInt(args) {
  3.     return Math.min(...args);
  4.   }
  5. }
  6.  
  7. var sif = new SmallestIntegerFinder();
  8. console.log(
  9.   sif.findSmallestInt([78, 56, 232, 12, 8]),
  10.   8,
  11.   "Should return the smallest int 8"
  12. );
  13. console.log(
  14.   sif.findSmallestInt([78, 56, 232, 12, 18]),
  15.   12,
  16.   "Should return the smallest int 12"
  17. );
  18. console.log(
  19.   sif.findSmallestInt([78, 56, 232, 412, 228]),
  20.   56,
  21.   "Should return the smallest int 56"
  22. );
  23. console.log(
  24.   sif.findSmallestInt([78, 56, 232, 12, 0]),
  25.   0,
  26.   "Should return the smallest int 0"
  27. );
  28. console.log(
  29.   sif.findSmallestInt([1, 56, 232, 12, 8]),
  30.   1,
  31.   "Should return the smallest int 1"
  32. );
  33.  
RAW Paste Data