Javascript push()简写? [英] Javascript push() shorthand?
本文介绍了Javascript push()简写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在向数组附加值时,是否有JavaScript(或者甚至是coffeescript) .push()
的简写?就像php的 $ array [] ='添加到数组';
。
Is there a shorthand for JavaScript's (or even in coffeescript) .push()
, when appending a value to an array? Much like php's $array[] = 'added to array';
.
推荐答案
不。
您只需使用 .push()
。
使用coffeescript只会让你方便地删掉括号。
The use of coffeescript will only afford you the convenience of dropping the parentheses.
这篇关于Javascript push()简写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文