menardmam
menardmam

Reputation: 9986

javascript string concatenation

I know that in php you can do

abc = 'some';

abc .= 'thing';

echo abc; will output : something

how to do that in javascript ?

i have try abc = abc + bcd... but there should be a better way

Upvotes: 2

Views: 324

Answers (1)

Naftali
Naftali

Reputation: 146302

try this:

abc = 'some';

abc += 'thing';

alert(abc);  // will output `something`

Upvotes: 6

Related Questions