Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project











OPERATORS:  +


+
 
The + plus string operator is used to concatenate (join together) two or more strings. This example joins together the three strings 'bread', 'and' and 'cheese' to produce 'bread and cheese':
 
document.write("bread " + "and " + "cheese");
 
...while the next one would, assuming 'x' to contain the string 'honey', return 'milk and honey':
 
document.write("milk and " + x);
 
The shorthand assignment operator can also be used to concatenate strings. If the variable 'x' has the value 'milk and ', then the following code will add the string 'honey' to the value in variable 'x' producing the new string 'milk and honey':
 
Code:
var x = 'milk and ';
x += "honey";
document.write(x);

 
Output:
milk and honey

 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information