This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using the (+) operator (overloading) | |
var string1 = "This is a "; | |
var string2 = "test" | |
var string3= string1 + string2; // creates a new string with "This is a test" | |
// alternative using the shorthand assignment operator (+=) | |
var oldValue = "apples"; | |
oldValue += " and oranges"; // string now has "apples and oranges" | |
// alternative using the built-in String method .concat |
NewerOlder