I was unable to figure out if there is a better way to report problems in an exercise, so I'm posting it here. This exercise as written in "What you'll be building" doesn't properly check the bounds of the text string when accessing it in the second loop. This problem will manifest if the first character of myName ever matches a character in text at an index of
If, for example,
text = "Hi, my name is Mel" and
myName = "Melody", the second loop will read to an index of 3 beyond the end of the text string and the final output will be
[ 'M', 'e', 'l', undefined, undefined, undefined ]
As this is an educational site presumably teaching some beginner coders, I think this exercise should be modified to include a bounds check and a brief explanation about the possibility of reading beyond the end of an array or string.
Apologies if this post is in the wrong area. If so, could the moderators either move it or direct me where the correct place would be.