Addition (+)

증가 연산자addition operator (+)는 숫자 또는 여러 문자열의 더합니다.

Syntax

Operator: x + y

Examples

Numeric addition

// Number + Number -> addition
1 + 2 // 3

// Boolean + Number -> addition
true + 1 // 2

// Boolean + Boolean -> addition
false + false // 0

String concatenation

// String + String -> concatenation
'foo' + 'bar' // "foobar"

// Number + String -> concatenation
5 + 'foo' // "5foo"

// String + Boolean -> concatenation
'foo' + false // "foofalse"

Specifications

Specification
ECMAScript (ECMA-262)
The definition of 'Addition operator' in that specification.

Browser compatibility

BCD tables only load in the browser

See also