Favorites

JavaScript + Addition Operator

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
+
JavaScript Arithmetic OperatorThis operator is supported by all modern browsers.
Updated 28th November 2026

The addition operator (+) adds two numbers, or joins two strings together when either operand is a string.

Description

The addition operator + produces the sum of two numbers. If either operand is a string, it instead converts the other operand to a string and joins them (concatenation), so 1 + '2' is '12'. That double role is a frequent source of bugs when numbers arrive as strings, for example from form fields; convert them first with Number().

Operands are evaluated left to right, so 1 + 2 + '3' is '33' but '1' + 2 + 3 is '123'. Template literals are often clearer than + for building strings. It also works with BigInt values, but not with a mix of BigInt and Number.

The + operator first converts objects to primitives, which is why adding arrays or objects gives strange strings such as [1] + [2] being "12". When adding decimals, results can show floating point rounding, such as 0.1 + 0.2; round for display with toFixed() or work in whole units, such as cents. The unary form, +value, is a different operator that converts a value to a number.

Properties

Operator
+
Category
Arithmetic
Precedence
11 (1 is lowest, 18 is highest)
Associativity
left-to-right

Syntax

x + y

Example

console.log(2 + 3);
console.log('Hello, ' + 'world');
console.log(1 + '2');
console.log(1 + 2 + '3', '1' + 2 + 3);
const qty = '4';
console.log(Number(qty) + 1);

Browser Support

The following information will show you the current browser support for the + operator. Hover over a browser icon to see the version that first introduced support for this operator.

This operator is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee