Forbrukslån Student | Laina | Beste kredittkort | Strømpriser | Billigste Husalarm | Bytte Forsikringsselskap | Billigste Mobilselskaper | Billigt Godis Online
JavaScript programming

Concatenation Operator JavaScript

Written by Tusher

JavaScript programming in the Concatenation Operator (Concatenation Operator) is used, multiple strings, strings and any other variables, as well as to add. Concatenation Operator (Concatenation Operator) of two types namely (+) sign and (+ =) sign. For example document.write ( “Hello” + “World”); Or var x = 50; document.write ( “The book has” + x + “pages.”); And var e = “Technology”; e + = “tutorials”; .

Practice Project:

body{background: #FFC;

<script type = “text/java script”>
document.write(“Hello ” + “World”);
document.write(“<br />”);
var x=50;
document.write(“The book has ” +x+” pages.”);
document.write(“<br />”);
var e=”Technology “;
e +=”tutorials”;


Notepad: to open a file type from the menu at the top of layer code by clicking on the Save as File name: index.html, Save as type: All files, save and open the index.html file with the Mozilla Firefox look like the image shown below.

  • At the top of the program document.write ( “Hello” + “World”); Through two separate string “Hello” and “World” as well as the Concatenation Operator (Concatenation Operator) (+) sign has been associated with. Hello World will be displayed in the browser.
  • Program var x = 50; As the value of the variable x is an integer number 50 has been set. document.write ( “The book has” + x + “pages.”); Here’s “The book has” and “pages.” To add a string between two variables x Concatenation Operator (+) sign is used. Browser The book has 50 pages. Will be displayed.
  • Program var e = “Technology”; e. = “tutorials”; In the case of var e = “Technology”; As the value of the variable e Value string “Technology” has been set. e + = “tutorials”; E expressing its previous value “tutorials” Sting also be added. document.write (e); When you view the e variable Technology tutorials will be displayed in the browser.


About the author