Use the concat() method to join the two strings: str1 and str2. - Javascript String

Javascript examples for String:Quiz

Description

Use the concat() method to join the two strings: str1 and str2.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var str1 = "Hello ";
var str2 = "World!";
document.getElementById("demo").innerHTML = str1.concat(str2);
</script>/*  ww w .  ja v  a  2 s.c o  m*/

</body>
</html>

Related Tutorials