Question

**PHP String Operators**
(.) Concatenation
(.=) Concatenation assignment

Function of a Concatenation assignment below.

var1 = "Helo";
var1 .= "World!";
echo var1;

The output above would be Helo World!

Q: Is there a similar operator like Concatenation assignment in javascript?

thanks.

I am looking for a Concatenation assignment not Assignment Operators, I ask for it because I do not know what it looks like, how would i know that += there was a concatenation operator? it only says assignment operator. And if you insist that it has a duplicate, then that link would be tittle something like concatenation... not assignment..., because assignment is very far similar than concatenation. Give my points back, I earned it hard!

Was it helpful?

Solution 2

Yes I believe there is, take a look at the += operator in the javascript console.

OTHER TIPS

Javascript concatenation assignment is += and the corresponding concatenation operator +.

var var1 = "Hello,";
var1 += " world!";

Yes, there is, but the concatenation operator is + not ..

Yes it's +=

E.g

var a = 'hello'
a += ' World1'
>>"hello World1"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top