Here you can find the source of next(index)
Array.prototype.next = function(index) { if (index === this.length - 1) { return this[0]; } else {//from w w w. j a va 2 s .c o m return this[index + 1]; } }
Array.prototype.next = function() { return this[++this.current]; }; Array.prototype.previous = function() { return this[--this.current]; }; Array.prototype.current = 0;
Array.prototype.next = function() { var i = this.__i || 0; if(i >= this.length - 1) { return { done: true }; else { i++; ...
Array.prototype.next = function() { if (!((this.index + 1) in this)) return false; return this[++this.index]; };
Array.prototype.next = function() { var current = this.shift(); this.push(current); return current;