Update javascript/editor.js

Fixes not outputting undefined when using document.write