21 Day Coding Challenge

Code 20 Passed test, but shouldn't have

#1

I did a .split / .join function without checking the hint or looking in the forums first. When I looked more carefully it appears that this is another poorly written challenge. “1” can either be “i” eg. th1s or in one place it’s an “l” w021d. When I ran my code, I never looked for “1d” so my answer should be wrong.

var theMessage = message.split(‘1’).join(‘i’);

Any word why mine worked?

#2

I got this way to work as well, but could not get it to work using .replace() method.

#3

Well technically, the L is a typo on their part. The challenge clearly states that it’s the vowels that aren’t processed properly.

3 Likes
#4

In order to complete the replace method you do something like this.
return message.replace(/0/g, “o”).replace(omitted).

2 Likes
#5

I’m guessing the REAL message does’nt have a the same erroneous substitution as the sample message - so there’s no problem.
I ignored it and and mine worked fine.

1 Like
#6

thank you! this helped me figure out why my code wasn’t working.

1 Like