Redo-stack realization on JavaScript