How to append a string value during assignment in Javascript?

前端 未结 7 1088
故里飘歌
故里飘歌 2020-12-10 08:04

Hey i dont know if that is possible but i want to set a given variable in js by reference.

What i want to do is, that each time i pass a string to t

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 08:50

    += works fine.

    var str = "stack";
    str += "overflow";
    
    console.log(str); //alert(str); Use firebug!!
    

    stackoverflow

提交回复
热议问题