Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Build a Quiz Challenge, Part 2 Solution

Peter Retvari
seal-mask
.a{fill-rule:evenodd;}techdegree
Peter Retvari
Full Stack JavaScript Techdegree Student 8,392 Points

?"I did it my way"?

Hi Folks, Could you please help? I displayed the HTML message (for my case is unordered list) in a different way. I didn't use another function to loop trough the ARRAY (bad and correct questions). I added to the if statements within the loop.

It works smoothly, however I wonder if a more experienced programmer could check if there something wrong with my code (e.g.: I wrote something in a stupid way, or it's not a good idea to use arrays like this..)

Here you can check my whole work: https://w.trhou.se/3ldv1qi38j

A million thanks in advance

Peace

another question btw :D How can I put here a code snippet? To display it in a "nice way"?

this method didn't work for me: ''' before and ''' after , or <div> before the code and </div> after

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

Looks good to me ?. I am not the greatest when it comes to the DOM, so I can't say whether there is a better way or not.

4 Answers

Steven Parker
Steven Parker
231,275 Points

Your program seems reasonably well constructed. But please do not post messages or code containing profanity, that's a violation of the Code of Conduct and might get you into trouble!

And to post code that looks nice, use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down: Ā  Or watch this video on code formatting.

Steven Parker
Steven Parker
231,275 Points

Remember to make a new snapshot after changing the code, and then replace the link in the question.

Steven Parker
Steven Parker
231,275 Points

What I meant was to edit the original question to change the link. But this new link still contains the code with the profanity along with a new version.