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.
Is this too messy?
I don't have any problems reading it but then again I just wrote it. Are there any ways I can improve on this? A different POV would help.
Mod Note Added some forum markdown to format the code for Community Forum
Jonathan GrieveTreehouse Moderator 90,845 Points
There's not much wrong with what you've done at all. You could maybe separate the longer concatenated strings into multiple lines in your text editor which might make the code a little easier to read but this is personal preference really.
One other thing you'll learn later on (not in this course) is template literals.... this is a relatively newer way to reference values and format strings in your code but as I say, that's for later.
As you get further into your coding journey you;'ll develop your own styles and preferences but good job on what you've done so far. :)
It looks perfectly fine to me, I did something similar but I made all the answers strings, and then checked simple equality in the if, not strict equality. I think your approach is better. Great job.