Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining.
Version:
GreenSock Docs
Timeline
.iteration()
.iteration( value:Number ) : *
Gets or sets the iteration (the current repeat) of timelines.
Parameters
value: Number
The repeat
to jump to.
Returns : *

Details
Gets or sets the iteration (the current repeat) of timelines. For example, if repeat
is 4, and the playhead is currently on its third repeat, .iteration()
will return 3
.
Including a number will cause the tween to jump to iteration number given. For example, if the repeat
is 4, and the playhead is currently on its third repeat, .iteration(2)
will make the timeline jump back to the second iteration.
var progress = myTimeline.iteration(); //gets current iteration
myTimeline.iteration( 2 ); //sets iteration the second iteration