Curious on question 7. Victory!


Does anyone know how we can fix the situation mentioned in that paragraph: if it print out all the letters just according to the first letter of name. How to add more conditions so it matches the letters from the name?


Instead of pushing each character found in your Second-FOR-loop,
you will have to collect these characters into a temporary variable using the concatenation.

AFTER leaving the Second-FOR-loop
( all characters have been collected in a temporary variable )
In an IF condition you compare myName with tempVar ( myName === tempVar )
and if true, you can than push myName into the hits-Array.


Thank you! It's very clear and helpful.


an alternative to concatenation is to use the javascript join() method.

so if have an array:
var arr = ["J", "a", "n", "e"];

you can join the elements to create a string "Jane" by typing:


As an aside, the "" argument means there will be no spaces in between the joined elements; that is, an argument of "," would create a string:

Hope this helps.

Victory! (Name Search+) Array Organization Question
Question 7 Attempts With Separate Array But Returns Error

Can you explain this in more detail? I'm not sure what you mean by "( all characters have been collected in a temporary variable )". How do I collect all characters into the tempVar variable?



I believe "second temporary variable" is referring to a variable that is assigned to an array. In other words, a second array. Does that help?