Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript String</h1> <h2>The concat() Method</h2> <p>The concat() method joins two or more strings:</p> <p id="demo"></p> <script> let text1 = "Hello"; let text2 = "World!"; let text3 = text1.concat(" ",text2); document.getElementById("demo").innerHTML = text3; </script> </body> </html>