Concatenation

By using the operator + between string variables (or between a string and a number), concatenation is being made (combining strings).

var firstName = "Ivan";
var lastName = "Ivanov";
var age = 19;
var str = firstName + " " + lastName + " is " + age + " years old";
// Ivan Ivanov is 19 years old

results matching ""

    No results matching ""