Skip to content

Instantly share code, notes, and snippets.

@louislatreille
Created August 6, 2021 16:05
Show Gist options
  • Save louislatreille/869abf2e927aa84f44531b05fcb9b4cd to your computer and use it in GitHub Desktop.
Save louislatreille/869abf2e927aa84f44531b05fcb9b4cd to your computer and use it in GitHub Desktop.
(Article) You should aim to forget how your code works
const decodeMorse = (morseCode) => {
return morseCode
.trim()
.split(/ | /)
.map( (code) => MORSE_CODE[code] || ' ')
.join('');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment