Thank you for the responses!
I learned from you suggestions, However they still neglect the undefined values.
While using GSAP 2 I used classes to store the animation information.
For example:
class Animation {
x: number
y: number
rotation: number
duration: number
constructor(...) {}
}
const createAnimation = (tl: gsap.core.Timelime, animData: Animation[]) => {
for( let i = 0; i < animData.length ; i++ ) {
tl.to(someElement, {...animData[i]}) // Doesn't work if the Animation object containes undefined value.
}
}
Once the animation has some undefined value, (because it is not needed) the animation stops.
Before changing the logic to work with GSAP 3, I wanted to be sure I am not missing something.
Thanks again!