DEV Community

Discussion on: Daily Challenge #47 - Alphabets

Collapse
 
andre000 profile image
André Adriano

My take on this challenge, with Javascript

const encode = str => [...str.toLowerCase().replace(/[^a-z]/g, '')]
        .map(ch => ch.charCodeAt() - 96)
        .join(' ');

Collapse
 
jasman7799 profile image
Jarod Smith

so simple love it