Exercise 3/7, Issue with friends[1]



As some of you may know on exercise 3 of this series, the below code does not work when you use friends[1] for your "friend" variable.


One possible solution is to use a different friend from the array, but I was curious what was wrong with friends[1]. For some reason, the double space between two of the words in the string seems to be what was breaking it. Remove one of the spaces, and it works. I'm not sure why the double space is causing the issue, but it is. So, remove the second space between "Hey Guys!" and "Wait Up!" in the title for friends[1].


once you taken the exercises, it isn't re-validated, so the only thing i can look at is the output:

which is fine with friends[1]


Hmm, I'm not sure if you can reset the workspace to reset the validation, but that might be a way to try it out. Either way, I'm assuming it has to do with a regex or whatever parser is being used to look for code errors in the editor. The regex is probably looking for exactly one space between words.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.