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

Computer Science

Need Help with Testing functions (console.log)

Hi, so I have a project on code.org (Unit 7 Lesson 9,10)that you have to make a library out of. The requirement was that you needed 2 functions with at least 1 loop, parameter, conditional statement, return value. I have built the function, but have no idea how to test it out using console.log. Can someone show me how to?

(Wanted to make functions that is like cereal calories guessing game, shows a picture of cereal, user input random calorie guess, if correct says right, if wrong, then says wrong. After one guesses regardless of right or wrong, it moves on to the next cereal)

Here is my code, its uneditible, but u can view. https://studio.code.org/projects/applab/ekIz6IpEFAOAz5Nsp2akylxDzTAsuW2mi5FVUr4kosc

Here is what I want it to do, but with NO screen UI and all on console. log https://studio.code.org/projects/applab/NzL6MI1j-_I0JsAYwUWYsozK6bTAnyl_ojbWYCQjVAo Can someone show me how I can show the game on console log? Also Does anyone know where I can add a for loop and a algorithm with sequencing, selection and iteration?