JavaScript String Method : concat()

The concat() method is used to concatenate or join the two strings. It basically does not modify the existing strings, but it takes two strings and assigned them to the third one. The syntax would be :
  newstr = str1.concat(str2);
Example :
<html>
<body>
  <script>
    var mystr1 = "This is The First String.";
    var mystr2 = "This is The Second String.";
    var newStr = mystr1.concat(mystr2);
    document.write(newStr);
  </script> 
</body>
</html>
Output :



Next Topic :