Answers for "code wars responsable drinker"

C
0

code wars responsable drinker

function hydrate(s) {
   let waterCount = s.split('').filter(e => e.match(/\d/)).reduce((acc, val) => +acc + +val, 0);
  return waterCount > 1 ? `${waterCount} glasses of water`: `${waterCount} glass of water`;
}
Posted by: Guest on April-09-2020

Code answers related to "C"

Browse Popular Code Answers by Language