Bob is a lackadaisical teenager. In conversation, his responses are very limited.
- Bob answers ‘Sure.’ if you ask him a question.
- He answers ‘Whoa, chill out!’ if you yell at him.
- He says ‘Fine. Be that way!’ if you address him without actually saying anything.
- He answers ‘Whatever.’ to anything else.
My Solution in JS:
Things to note:
- Second part of line 11 is a clever way (that I did not come up with myself) to check if a string is alpha characters or not. (You can also use regex to check if a string fits a certain criteria for characters.)