> this.next = function() {
> (!(++this.position < this.array.length)) && (this.position =
> 0);
> return this.array[this.position];
> }
Why not use modulo on the position and return
this.array[this.position++ % this.array.length] for next and -- for
prev?
------------------------
Gary Katsevman
Computer Science Undergraduate
Northeastern University
gkatsev.com
--
You received this message because you are subscribed to the Google Groups "The
JSMentors JavaScript Discussion Group" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jsmentors?hl=en.