Is there a difference between ++i and i++ in this loop?
问题 The array.prototype.reduce function at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce It has the following loop: for (index = 0; length > index; ++index) { if (this.hasOwnProperty(index)) { if (isValueSet) { value = callback(value, this[index], index, this); } else { value = this[index]; isValueSet = true; } } } I don't think there is a difference whether the index is pre or post incremented here since it's done after the loop iterates each time