newval had undefined value in some cases

Hi, i discover that when selecting the whole text and deleting it with the "del" key or when pressing "del" multiple times deleting text from start to end, sometimes this method would break by saying that newVal was undefined. (Im using VisualStudio for debbuging and this makes noise, maybe using Chrome's debugger you can't even see this error or it's hidden somewhere and doesn't make much noise).
This is a quickfix cause i don't have a lot of time right now to look into it or if this can be fixed a little bit more "clean".

Let me know if this is happening to you to.
Great library! thanks :+1: