I was wondering if anyone has a simple, clear way to describe the concept of console.log to students. Perhaps I am not clear enough on it myself yet. We are working on Unit 3, Lesson 14 (Conditionals) and the best way I have come up with to explain console.log is that it is used to evaluate Boolean expressions (true or false) but there is more I can’t quite explain. For example, on Level 5 of Lesson 14, the console reads “winner” once the racear reaches a certain point. Does anyone have a simple, but perhaps more broad way of describing console.log? Any insights are appreciated.
What a great question. My view of Console.log is it’s an invaluable tool to help the programmer see things within the program even when the program isn’t outputting information to the user. Some examples include: seeing the value of a variable even if it isn’t being shown to the user so you can see why your if statement may not be running OR a simple statement in a function to see if the function is running even if there isn’t output. It is one tool in your toolbox to find solutions. Game Lab also has the “watcher” which is similar but without GameLab, you would use Console.log. There are many other examples and ideas for using Console.log - hopefully others will reply.
Thank you for this Michelle. Your feedback here is very helpful!