function Loop(array) { this.array = array; } Loop.prototype.next = function() { return this.array[this.array.length - 1];