Skip to content

Commit

Permalink
Solucion reto #1
Browse files Browse the repository at this point in the history
  • Loading branch information
aldogodoy authored May 23, 2023
1 parent 521fb74 commit cb3195d
Showing 1 changed file with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
function alphabet (letter) {
const alfabeto = {
a: "4",
b: "I3",
c: "©",
d: "|)",
e: "€",
f: "ƒ",
g: "9",
h: "#",
i: "1",
j: "]",
k: "1<",
l: "£",
m: "IVI",
n: "И",
o: "ø",
p: "|*",
q: "ℚ",
r: "Я",
s: "$",
t: "7",
u: "µ",
v: "▼",
w: "ω",
x: "×",
y: "¥",
z: "2",
' ': ' '
};
return letter in alfabeto ? alfabeto[letter] : ' ';
}
function leet(word) {
const words = [...(word).trim().toLowerCase()]
let auxWords = [];
for(let i = 0; i < words.length; i++ ){
auxWords.push(alphabet(words[i]))
}
return auxWords.join(' ')
}
leet('El lenguaje hacker');

0 comments on commit cb3195d

Please sign in to comment.