`this._text.slice(end, 0)` returns empty string, replace with `this._text.slice(end)`. (See http://www.ecma-international.org/ecma-262/5.1/#sec-15.5.4.13 step 7) Also, the `slice` is less readable, use `substring`