12
如何提早打破reduce()方法?
如何中断reduce()方法的迭代? for: for (var i = Things.length - 1; i >= 0; i--) { if(Things[i] <= 0){ break; } }; reduce() Things.reduce(function(memo, current){ if(current <= 0){ //break ??? //return; <-- this will return undefined to memo, which is not what I want } }, 0)