Prev Demo
Concat Method For Joining The Strings To Form A Sentence In Javascript
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click on the "Button" to join the three strings.</p> <input type="button" value="Click to Join" onclick="Function()" /> <p id="myId"></p> <script> function Function() { //This is a String// var a = "Mr. "; //This is a String// var b = "Sheo "; //This is a String// var c = "Narayan"; //This is a String// var d = " is a Software"; //This is a String// var e = " Professional." //This is a String// var res = a.concat(b, c, d, e); document.getElementById("myId").innerHTML = res; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output