DEV Community

Discussion on: Daily Challenge #47 - Alphabets

Collapse
 
jasman7799 profile image
Jarod Smith
const alphaPosition = str => [...str]
  .filter(letter => letter.toLowerCase().charCodeAt(0) - 96 > 0)
  .map(letter => letter.toLowerCase().charCodeAt(0) - 96)
  .reduce((s, pos) => s += `${pos} `, '')
  .trim();

classic map filter reduce problem loved it.