Q:

Is there a JavaScript equivalent to "string" . "string" in PHP?

I am currently learning a little bit of JavaScript and had a question.
In PHP, I am used to binding text and strings together with a simple dot like this:
echo "Text" . $String . "anotherText" . $anotherString

Is this possible in JavaScript? (Not the echo, but the binding of the strings and text.)

A:

The + is the concatenation operator in JavaScript:
"Text" + somestring + "anotherText" + anotherString;

A:

In JavaScript it's + instead of .
Example 1:
document.write("Text" + somestring + "anotherText" + anotherString);

Example 2:
alert("Text" + somestring + "anotherText" + anotherString);

Example 3:
var john = "Text" + somestring + "anotherText" + anotherString;

