在JavaScript中对数组求和的最快方法是什么?快速搜索一下a few different methods,但如果可能的话,我想要一个本机解决方案。这将在SpiderMonkey下运行。
在我一直使用的盒子里思考:
var count = 0;
for(var i = 0; i < array.length; i++)
{
count = count + array[i];
}
我相信有一种比直接迭代更好的方法。
https://stackoverflow.com/questions/3762589
复制相似问题