Marader
0
Q:

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`;
}
0

Tags

New to Communities?

Join the community