FAQ: Introduction to JavaScript - Arithmetic Operators

This community-built FAQ covers the “Arithmetic Operators” 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 Arithmetic Operators

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: What is the difference between printing 3 + 4 and '3 + 4'?

Kind of a funny lesson =)

1 Like

7 posts were split to a new topic: How does Javascript handle a negative modulo? (-5 % 20)

why is it when i do ‘‘console.log(240/65)’’. it says ‘‘Did you divide 65?’’

1 Like

Are you sure of your understanding of divide 65 by 240?

yeah i do understand

So have you sorted out your question, then?

Do I need to put spaces between the symbols in parentheses or it’s ok to go without them? like “console.log(3 + 4)” or “console.log(3+4)”

Welcome, @py9568079721.

No, spaces are not needed; however, keeping white space around operators lets them stand out and makes readability and debugging much easier so it is recommended.

y = m * x + b

as opposed to,

y=m*x+b
3 Likes

Idk why im even paying for this site…

var age = 21;
console.log(age + 3.5);

Results in the Console logging 24.5

Still i the Result doesnt count and i need to go to baby level ???
console.log(21 + 3.5);

Did the instructions ask us to create a variable for our age? Seems the author meant for us to literally write it into the console.log() statement.

P. S. Griping is not going to win you much support. Pull up your socks and invest yourself. Forget about the money. The real investment is your attitude and effort.

“/” is the JavaScript way to divide

Why does the remainder of console.log(5%20) = 5 and not 0?