Like most people, it’s about the text editor question.
The requirement is to implement BACKSPACE instead of DELETE (which means deleting the character before the cursor), but it’s similar to delete.
The original poster did the JavaScript version. Here are some basic test cases for everyone.