Typing and deleting letters of a word in the JS

Hi There @coothead
Thank you so much for writing such a code, and your code is a great work to learn and acquire some new knowledge,

But sir irrespective of what I actually posted my agenda was to learn something as in GIF:

  1. Write a character of a word one by one in the forwarding direction, and delete them in the backward direction.

  2. Words will also change after the first word is written and deleted.

And the same process will be repeated for other words stored in an array or maybe some other way.

I was able to write it down for one word in one direction, but could not delete it and also could not further add an additional word to be written and deleted.