Skip to content

Instantly share code, notes, and snippets.

@nikoheikkila
Created June 22, 2019 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikoheikkila/b0ed5826dc372125e89376fb78a29719 to your computer and use it in GitHub Desktop.
Save nikoheikkila/b0ed5826dc372125e89376fb78a29719 to your computer and use it in GitHub Desktop.
Make text L337'er!
const leet = char => {
const charMap = {
'A': 4,
'E': 3,
'I': 1,
'S': 5,
'T': 7,
}
char = char.toString().toUpperCase()
return charMap[char] || char
}
const leetText = text => [...text].map(leet).join('')
export default leetText
// console.log(leetText(`intelligence is the ability to adapt to changes.`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment