Commenting Code Out with //

Question:
I notice that the host did not comment out his top lines 1-9 before going to the next projects. Is it necessary to comment out all code with // prior to moving to the next practice?

Repl link:
fork-this-javascript-course-by-clever-programmer.eugerald05.repl.co

//console.log('Food')
//console.log('James Russell')

//variables
let name= 'James Russell'
console.log(name)

//sentence = 'How are you doing today, nice to see you, hope you have a great day!'
//console.log(sentence)
4 Likes

It’s not necessary, as it’s still valid JS.
But, if we have this code, for example:

let Name = 'James Russell';
//let Hello = 'Hello, ' + Name;
console.log(Hello)

Than it would be an issue, as we’re referencing a non-existent variable.

2 Likes