Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var userInput = "five plus five equal to ten multiply 5";
  2.  
  3. const punctLists= {name: 'star', tag: '*'},
  4. {name: 'bracket', tag: ')'},
  5. {name: 'multiply', tag: '*'},
  6. {name: 'plus', tag: '+'},
  7. {name: 'double equals', tag: '=='},
  8. {name: 'equal', tag: '='}]
  9. var matchPunction = punctLists.find( tag => tag.name == userInput);
  10. if(matchPunction){
  11. text=matchPunction.tag;
  12. }
  13.  
  14. var userInput = "5+5 = 10*5";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement