Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var commandProcessor = (function() {
- var text = '';
- return {
- append: (newText) => text += newText,
- removeStart: (count) => text = text.slice(count),
- removeEnd: (count) => text = text.slice(0, text.length - count),
- print: () => console.log(text)
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment