Digium interview question

Basic JS problems on a projected text editor