concat() method joins two or more strings.
syntax ↴
concat(str1, str2, /* …, */ strN) ↴
str1, …, strN One or more strings to concatenate to str1.
If the arguments are not of the type string, they are converted to string values before concatenating.
concat() method does not change the existing strings.
concat() method returns a new string.
There are other ways to join strings ↴
1. The + operator:
'Hello' + ' ' + 'World' returns ↴
'Hello World'
2. Template literals:
let a = 'Hello'; let b = 'World';
`${a} ${b}` returns ↴
'Hello World'
enter values for str1 and/or str2 and/or str3
str1.concat(str2, str3, ..., strN)