Benefit of concatenation


whats the benefit of concatenation if`

console.log("hey you);
cosole.log(""hey"+" "+"you");

provide same output

hey you`


Yup! Concatenation in the above example is useless. But what if you want to do something like this

var day = 15;
var year = 2016;
console.log(day + " September " + year);

See the result:,console

With the help of concatenation, we can combine variables and string.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.