[JS typewriter] Handle backspace at the beginning of a line

It makes the backspace key work as expected when you press it at the beginning of a line.