What is JavaScript Arithmetic Operators ?

What is JavaScript Arithmetic Operators ?

Arithmetic Operators perform arithmetic on numbers (literals or variables) and produce a result, in javascript, it`s more of logic than mathematics but right-thinking to understand the operators and how to use them in your coding journey, you will need to perfect basic mathematics logic to solve a lot of problems and wright algorithms in your coding journey.

There are 7 javascript operators

Addition Operator - The symbol is +, Addition is the method of calculating the total of two or more numbers to know the sum of the numbers, See below a code snippet on how you can use addition in Javascript.

Code snippet image.png

Demo Sep-30-2021 16-04-50.gif

Subtraction Operator- The symbol is -, Subtraction is the process of taking away a number from another, is the method of calculating the difference between two numbers.

Code snippet image.png

Demo Sep-30-2021 16-15-00.gif

Multiplication Operator- The symbol is *, Multiplication is the process of adding a number to itself a certain number of times: the act or process of multiplying numbers

Code snippet image.png

Demo Sep-30-2021 16-20-54.gif

Division Operator- The symbol is /, and division is a method of distributing a variable into equal parts.

Code snippet image.png

Demo Sep-30-2021 16-56-14.gif

Modulus operator - The symbol is %, this operator determines the remainder. In some cases, the remainder maybe 0, which means the number is completely divisible by the divisor. The modulus operator is not to be mistaken for division.

Code snippet image.png

Demo

Sep-30-2021 17-06-10.gif

Increment operator. - The symbol is ++, Increase operand value by one.

Sep-30-2021 17-37-51.gif

Decrement operator. - The symbol is --, Decrease operand value by one.

Sep-30-2021 17-37-45.gif

in Javascript, the symbol for multiplication is * (asterisk) and not x like mathematics and the modulus operator is different from the division

These are some of the things you should take note of

in Javascript, the symbol for multiplication is * (asterisk) and not x like mathematics and modulus operator is different from division