free method

dynamic free(
  1. dynamic animation
)

Implementation

free(animation) {
  splice(animations, animations.indexOf(animation), 1);
  animation.onEnd && animation.onEnd();
}