0
Help (javascript code)
Hello, can anyone tell me if this code is correct? The function must return the string parameter, and must replace the e's with 3's, the i's with 1's and the o's with 0's. On a site it said it was good but I have a big doubt unless there are several ways to do it. Help me please!
5 Answers
+ 1
could you link your code so we can have a look?
+ 1
// Output: S0l0L3arn
function rep(s){
s = s.replaceAll('e', '3');
s = s.replaceAll('i', '1');
s = s.replaceAll('o', '0');
return s
}
console.log( rep("SoloLearn") );
+ 1
Thank you! But I don't why on the site they said that my code was correct :/ do they're differents methods to use?
+ 1
No problem šš
0
Apollo-Roboto sorry I forget to add my code :
function remplacerLesLettres($string){
return $string
if(varchar = e)
return 3;
if(varchar = i)
return 1;
if(varchar = o)
return 0;
}