JavaScript Arithmetic Operators
JavaScript Arithmetic Operators
The arithmetic operators
perform arithmetic operations on numbers (either literals or variables) as their operands and return a single numerical value. The following are the list of arithmetic operators available in JavaScript.
Addition
In the following example, we will add the two given numbers (50, 45).
Example
JavaScript Arithmetic Operators
The following are the list of arithmetic operators available in JavaScript.
Operator | Explanation | Operation | Result |
---|---|---|---|
+ | Addition | 50 + 45 | 90 |
- | Subtraction | 50 - 45 | 5 |
* | Multiplication | 5 * 2 | 10 |
/ | Division | 7 / 2 | 3 |
** | Exponentiation | 5 ** 2 | 25 |
% | Remainder (Modulus) | 7 % 2 | 1 |
++ | Increment | ++5 | 6 |
-- | Decrement | --5 | 4 |
Subtraction
In the following example, we will subtract the two numbers (50 and 45).
Example
Multiplication
In the following example, we will multiply the two given numbers (5 and 2).
Example
Exponentiation
In the following example, we will perform the operation of raising one quantity to the power of another (52).
Example
Division
In the following example, we will divide the two given numbers (7 by 2).
Example
Modulus
In the following example, we will find the remainder of the two given number (7 and 2) when dividied.
Example
Increment
In the following example, we will increment the given number (3).
Example
Decrement
In the following example, we will decrement the given number (3).
Example
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.