The concat() method can be used instead of the plus operator. These two lines do the same:
var text1 = "Hello";
var text2 = "World";
text3 = text1.concat(" ",text2);
alert(text3);
var text = "Hello" + " " + "World!";
var text = "Hello".concat(" ","World!");
alert(text);
var text1 = "Hello";
var text2 = "World";
text3 = text1.concat(" ",text2);
alert(text3);
var text = "Hello" + " " + "World!";
var text = "Hello".concat(" ","World!");
alert(text);
No comments:
Post a Comment