javascript字符串连接 [英] javascript string concatenation
本文介绍了javascript字符串连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道在php中你可以做到
I know that in php you can do
abc = 'some';
abc .= 'thing';
echo abc; will output : something
如何在javascript中执行此操作?
how to do that in javascript ?
我试过abc = abc + bcd ...但是应该有更好的方法
i have try abc = abc + bcd... but there should be a better way
推荐答案
试试这个:
abc = 'some';
abc += 'thing';
alert(abc); // will output `something`
这篇关于javascript字符串连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文