Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Students list challenge. Not sure how to go further
I am stuck (as always). I was excited I powered through the first steps, just to hit a wall. I'd like to have some help if possible, a feedback, but not a solution.
Could you please provide a little push, so that I can move in the right direction?
That's what I've built so far. I am not sure if all of this is necessary. However, I am able to log all the names in a new Array. What I want to do is to print the name that the user writes in the prompt dialog.
The program asks questions in a loop. If the user writes a name that is in the system, then there's a match and all the students get logged in the console. Somehow I have to tell the system : write the information about the student you typed in.
In which direction should I move?
As always, I do appreciate your time!
Steven Parker216,810 Points
Here's a few hints (no code):
The prompt should be done before the search loop. This allows the program to check each name for a match without asking for more input. If you want to be able to do more than one search, you'll need another loop around everything.
You'll also need a process to convert the contents of a student object into a string to make it visible on the page. In the next video this is done in a function.
I am posting here my solution for anyone interested in knowing more about the challenge. This is not as dry as some responses here, because I am asking the system to store the answer to a new Array, which is not needed. I am also not using a nice styled message at the bottom, or .toLowerCase() as an option, however the core of the program is there