Advertisement
divanov94

Untitled

Oct 9th, 2020
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function commandProcessor(){
  2.     let text="";
  3.     return {
  4.         append:(t="")=>(text+=t),
  5.         removeStart:(n=0)=>(text=text.substring(n)),
  6.         removeEnd:(n=0)=>(text=text.substring(0,text.substring.length-n)),
  7.         print:()=>console.log(text),
  8.     }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement