About javascript


hi this is abhijeet
the thing is
1. I put up 2 math problems

but result is displayed for the second problem only

why so??


It only shows the second one, because in order for information to be logged in JavaScript, you must use console.log(). JavaScript automatically outputs the last evaluation, or piece of information that you write in your script.

Example of Logging:

console.log(5 + 5);
console.log(5 ** 5);
console.log(5 - 5);


Hey @abygrwl29 normally if you actually work on your own project and type this up, it wont show anything since you didnt log anything to the console(assuming you know about that). Codecademy (dont take my word for this), somehow has a code that prints the last thing to the console somehow. Im not sure but as i said if you do this project on your own nothing will show up on the console. The way to make something show up to the console is by logging it to the console, so like this:

console.log("Hi i am abygwrl29")

So on the console here Hi i am abygwrl29 would show up as a string. Anways i hope this helped, if you have any questions please post down below!

@cadecodes im not sure about this:


Let me clarify,

*if you didn't log anything else to the console.


Are you sure about that? :

Let me quickly check.

Just checked on my console, and it actually didnt show up on the console


I'm pretty sure :slightly_smiling: ! Just go ahead and confirm it for me! :wink:


Ugh, now I have to check mine, brb! :smile:


@amanuel2, you have bested me! It doesn't show up in my Notepad++


Yea, its some codecademy script that lets it does that. Not sure for what purpose


Probably just some weird tester. Codecademy is confusing sometimes.


Guys thanks for your support .
Since I am new to programming , WHAT IS CONSOLE ?


Wow thats hard to explain but....

Basically console is where you see if there are any errors, test some logic, and other things. Since i cant explain this very good so here is a good site to learn about console, but you can look here:


@cadecodes im stuck on lesson 2 please help would be appreciated

      -love you



You spelled anonymous wrong.