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
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.
Thanks guys. Now I understand!
