typescript concat code example

Example 1: concat string typescript

var str1 = new String( "This is string one" ); 
var str2 = new String( "This is string two" ); 
var str3 = str1.concat(str2.toString());
console.log("str1 + str2 : "+str3)   
// str1 + str2 : This is string oneThis is string two

Example 2: typescript list concat

var alpha = ["a", "b", "c"]; 
var numeric = [1, 2, 3];

var alphaNumeric = alpha.concat(numeric); 
console.log("alphaNumeric : " + alphaNumeric );

Example 3: typescript string concatenation best practice

str = `${year}-${paddedMonth}-${day} ${hours}:${minutes}:${seconds} `;