Steven Parker172,268 Points
It looks like a closing brace is missing at the end of the "printlist" function. It should go on or near line 14.
Your listHTML variable is declared inside of your printlist function but you are updating it and then returning it outside of that function. You may try moving those two lines of code into your function preceding the final curly brace.
Ah I figured it out. You also were missing a closing curly brace after your printlist function which was causing your program to think that the closing curly brace for printlist was the closing bracket for your final for loop. Here's the code with the correction. This works fine. See my previous comment as well though. You will need to move
listHTML += '</ul>'; and
return(listHTML) inside your printlist function.
Stacy Loggins2,940 Points
Thanks so much for all your help guys. It was originally a closing curly brace on my print list function that was causing the problem. Ben thanks for the information about declaring variables I will keep that in mind when creating new variables! correct me if I am mistaken but if you put the listHTML += '</ul>'; inside the for loop it will print out </ul> between each list item which wont print out correctly. Also when you see undefined print out on the web page it is being caused by the <p> tags at the bottom when I was creating the string. I just removed them and it doesn't appear on the page anymore.