From the course: JavaScript Essential Training

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Math operators

Math operators

- [Instructor] Computers are really good at computing as in doing math and in JavaScript, you'll often have to do math to convert or combine or subtract or multiply or divide values or do other things. For all of this we have standard arithmetic math operators. In the exercise files I've set up an example so we can play around with this. So you can see it here. We've set up some lets with different values. Let me just output those lets into the console so we can see what they are. And then we have this lets called results down here where we can do a math operation and the result is placed inside the result let and then we just output it. So right now we are doing an addition using the plus symbols. So we are taking the value of A plus the value of B the result is nine because it's five plus four. We can also do a subtraction by putting in a minus symbol. This gives us A minus B the result is one. If we want to do…

Contents