本文档基于 CC协议(Creative Commons Share-Alike License)发布,是developer.mozilla.com, www.mozref.comwww.aptana.com共同劳动的成果。

+

Adds two values together or concatenates two strings into a single string.

Syntax

numberA + numberB or stringA + stringB

Example

//Addition:
myVar = 2 + 2; //myVar = 4;
//Concatenation:
var firstName = "Joe"; var lastName = "Smith"; var fullName = firstName + " " + lastName; // fullName = "Joe Smith";