Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var userInput = "five plus five equal to ten multiply 5";
- const punctLists= {name: 'star', tag: '*'},
- {name: 'bracket', tag: ')'},
- {name: 'multiply', tag: '*'},
- {name: 'plus', tag: '+'},
- {name: 'double equals', tag: '=='},
- {name: 'equal', tag: '='}]
- var matchPunction = punctLists.find( tag => tag.name == userInput);
- if(matchPunction){
- text=matchPunction.tag;
- }
- var userInput = "5+5 = 10*5";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement