Operators
Addition operator (+)
The binary plus operator converts operands to primitive values, then performs string concatenation if either primitive is a string; otherwise it performs numeric addition. Mixing BigInt and Number in numeric addition throws TypeError.
Formal Syntax & Structure
javascript syntaxjavascript
left + rightParameters & Attributes
| Name | Type | Description |
|---|---|---|
| left | expression | Left operand. |
| right | expression | Right operand. |
Return Value
number | bigint | string
Result depends on operand conversion.
Working Example
Example Snippetjavascript
console.log(4 + 5);console.log('4' + '5');