Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining.
GreenSock Docs (HTML5/JS)
TweenLite
.totalDuration()
Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax).
Parameters
value: Number
(default = NaN
) — Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining.
Returns : *

Details
Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). For example, if a TweenMax instance has a duration
of 2 and a repeat of 3, its totalDuration
would be 8 (one standard play plus 3 repeats equals 4 total cycles).
This method serves as both a getter and setter. Omitting the parameter returns the current value (getter), whereas defining the parameter sets the value (setter) and returns the instance itself for easier chaining, like myAnimation.totalDuration(2).delay(0.5).play(1);
var ctd = myAnimation.totalDuration(); //gets current total duration
myAnimation.totalDuration(2); //sets total duration