title: Matching substring to user input
body: <p>I have a user input string and on basis of that, I execute case statement of the switch.For example, if user types string hello is taken to case hello.Everything works fine but when I put string ='<strong>shimla weather</strong>' it takes it to 'hi' because that matches first.
  How can I better implement this? </p>
  
  <pre><code>var string = 'shimla weather';
  var substring = ['hi', 'hello', 'weather', 'joke'];
  console.log(substring);
  var doubles = substring.map(function(x) {
      if(string.includes(x)){
        expression = x;
      }
    });     
    console.log(expression);          
    switch(expression) {
      case 'hi':
      case 'hello'
          console.log('hello');
          break;
      case 'weather':
      console.log('weather');
          break;
      case 'joke':
          console.log('joe');
          break;
      default:
  
  }
  </code></pre>