About javascript


#1

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??


#2

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);

#3

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:


#4

Let me clarify,

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


#5

Are you sure about that? :

Let me quickly check.

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


#6

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


#7

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


#8

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


#9

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


#10

Probably just some weird tester. Codecademy is confusing sometimes.


#11

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


#12

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:


#14

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

      -love you

    -annonmous

#15

You spelled anonymous wrong.