Bug Report: Console Weirdness

The console is doing some weirdness in the Build an Email Masker Lab. See the console logs from when i<9 in the while loop: attached image

the console is not doing anything weird, you are seeing the behavior of replace: if you want to replace an h it replaces the first one in the string, not the last one

1 Like

Hi @Darknoisepilot and welcome to our community!

Note that the replace method will replace the first instance which it finds of the pattern which it is searching for. So, if email[i] happens to be the character β€˜h’, it will replace the first β€˜h’ which it finds, even if it is not at the same index.

For future reference, if you need help with a particular challenge it’s best not to post screenshots.

Instead, please click the Help button, which appears after you have submitted incorrect code three times.

This will create a forum post which automatically includes your full code, a link to the challenge and an opportunity for you to describe your issue in detail.

1 Like

Thanks guys. Now I understand!