English to leet conversion javascript

Viewed 22

i'm writing a code to convert any string to the leet equivalent but i'm having trouble converting the string to leet. the code should also be able to handle upper and lower case letters.

my code

let letters = [ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ];

let leetChars = ['@', '8', '(', '|)', '3', 'ph', 'g', '#','l', '_|', '|<', '1', "|'|'|", '/\/', '0', '|D', '(,)', '|2', '5', '+', '|_|', '|/', "|/|/'",'><', 'j', '2'];



function leetTranslator (str){
    translation='';
   
   
       
       return translation 
 
}

i've tried to compare the string and the values for leet but it does not work.

0 Answers
Related