Created
June 22, 2019 13:57
-
-
Save nikoheikkila/b0ed5826dc372125e89376fb78a29719 to your computer and use it in GitHub Desktop.
Make text L337'er!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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