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
Demo
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
Demo
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
Demo
Division Operator- The symbol is /, and division is a method of distributing a variable into equal parts.
Code snippet
Demo
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
Demo
Increment operator. - The symbol is ++
, Increase operand value by one.
Decrement operator. - The symbol is --
, Decrease operand value by one.
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