Essential Question: How can I write comments in my project?
Mastery Objectives:
SWBAT write comments in their code.
SWBAT comment out multiple sections of code for troubleshooting.
SWBAT write multi-line comments in their code.
Do Now: Create the variable below.
console.log('It was love at first sight.');
console.log('The first time Yossarian saw the chaplain he fell madly in love with him.');
console.log('Yossarian was in the hospital with a pain in his liver that fell just short of being jaundice.');
console.log('The doctors were puzzled by the fact that it wasn\'t quite jaundice.');
console.log('If it became jaundice they could treat it.');
console.log('If it didn\'t become jaundice and went away they could discharge him.');
console.log('But this just being short of jaundice all the time confused them.');
Above is the beginning of the book Catch-22 by Joseph Heller.
On line 1, write a single line comment that says Opening line. Use // to create a single line comment.
Single line comments are great for adding context to your code. Multi-line comments are often best suited to prevent a block of code from running. However, both types of comments can be used for either purpose.
Use a multi-line comment so that the last 6 console.log() statements are all commented out. The format is:
/* text goes here
*/
On the first line, write a single-line comment with the title of the book and the author.
At the bottom, write a knock-knock joke using multi-line comments.
Using a single-line comment, write your name on your code.
Run your program and take a screenshot and submit to google classroom.
Ticket-to-leave: In the comments below, write a single line comment and an multi-line comment.