FAQ: Introduction to JavaScript - Comments

This community-built FAQ covers the “Comments” exercise from the lesson "Introduction to JavaScript ".

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Introduction To JavaScript

FAQs on the exercise Comments

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

3 posts were split to a new topic: How do I do ex 2?

A post was split to a new topic: What goes in console.log?

5 posts were split to a new topic: Why would you want to prevent code lines from running by using comments?


hi everyone.
do anyone know what could it be?

The lines are commented out, alright, though perhaps the lesson checker is looking for comment tokens on their own lines.

    /*
    code
    code
    code
    */


thanks for your help.
there is no tokens or key words required.
and it is still not works.
will try to fix my troubles with fonts that i had before and will check again.
happy holidays !

1 Like


oh dear. i feel so stupid

7 Likes

The opening line to Catch 22 does not display for me, has this happened to anyone else?

2 posts were split to a new topic: Where does my error come from?

Hi!
There is a mistake in the lesson which should be fixed : " 1. A single line comment will COMMENT OUT a single line and is denoted with two forward slashes // preceding it. :
// Prints 5 to the console
console.log(5);"
There is a mismatch between example and explanation since example is about commenting while explanation is about commenting out.
There is very confusing when you a total beginner.

hey why i’m not able to see on right what the ques is saying…i’m getting always the command which i ran last time. please help

Did you click Run? It should display 645 in the console.

all is fine but i’m not getting ques 2 format on right side to which i could edit…read ques 2 on the left side.
I can’t find bottom 6 console.log :worried:

Does the exercise ask us to put a comment inside the console.log()? Perhaps remove that comment and only leave the one to the right of that.

I’m not able to see where bottom 6 statements are so that i could commented them out. I think there is some problem with codecademy interface. please you open this link https://www.codecademy.com/courses/introduction-to-javascript/lessons/introduction-to-javascript/exercises/comments and i think you also see either a blank app.js pane or you’ll see the prev ran command. Where is the paragraph or bunch of statements which i have to comment out… :disappointed_relieved:

Suggest Reset the lesson AND do a hard refresh (Ctrl+F5). There should be a number of statements in the editor.

1 Like

yeah problem resolved. thank you. ctrl+f5 and then resetting works. :grinning:

1 Like

Can someone please clarify the difference between the two data types in JS null and undefined. As far as I know undefined is some number divided by zero. Please give more clarification. These terms seems ambiguous. Thank you… :slightly_smiling_face:

Division by zero is undefined because zero is undefined. JS calls this infinity. That’s a math concern.

undefined is when a variable has no defined value.

    let a;

    console.log(a)    //  undefined

It is also the case when a function has no return value, such as, console.log(). When JS is asked to evaluate the return it gives, undefined.

    console.log(console.log())    //  undefined

undefined is not an object.

null on the other hand is an object. It is the top of the prototype chain, although it has no prototype of its own, and no attributes. It is the only thing above Object, from which everything else is derived.

1 Like