Addition Operator
In JavaScript, arithmetic Addition Operator is used to find the sum of two numeric values.
Syntax
+
symbol is used for arithmetic addition operator.
Arithmetic addition operator takes two values/variables as operands and returns their sum.
a + b //variables
6 + 74 //values
More than two values/variables can be summed in a single expression by chaining addition operator.
a + b + c + d //variables
6 + 74 + 5 + 10 + 85 //values
Examples
- Find the addition of values in
a
andb
.
var a = 10;
var b = 25;
var sum = a + b;
console.log(sum);
2. Find the addition of more than two values/variables.
var a = 10;
var b = 25;
var c = 14;
var sum = a + b + c;
console.log(sum);