StringOperator-2

 

+= string operator concatenate two strings

 
 
 
<!DOCTYPE html> <html> <head> <title>Welcome to LearnKode - A code learning platform</title> </head> <body> <p>The assignment operator += can concatenate strings.</p> <p id="sample"></p> <script> txt1 = "What a"; txt1 += " good day"; document.getElementById("sample").innerHTML = txt1; </script> </body> </html>
Output