Watching this video, I was happy to see that Dave debugged the program mostly the same way I did in response to the challenge in the previous video. However, there was one difference.
Dave typed the console.log functions into script.js, whereas I had typed it into index.html, doing my best to keep them at the beginning and ends of the program, like so:
I got the same result as Dave in the preview's console. My question is, is this just as valid, or is it a bad habit for reasons that will be revealed later on as I gain more experience?
Also, were my inline console.log functions truly placed in the "beginning" and "end" of the program through my method?
Tim KnightTreehouse Moderator 28,846 Points
It's absolutely just as valid when you want to see when the script started and ended like you did. However it's often best to run it in the script itself so you don't have to add additional script calls. Also adding it in the script would let you add
console.log commands in the middle of functions to see that specific functionality is running correctly.