title: use value of array in another array to parse sentences
body: <p>I am creating a chatbot and i need help, i have googled alot but nothing helped me.</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code>var input = $('#InputField').html(); //consider it as hi, how are you!
  
  var commonGreetings = ["hi", "hello"];
  var questions  = [{commonGreetings} +",how are you!"]; // i want to check if first word of sentence is in the array named commonGreetings.
  </code></pre>
  
  <p>//then</p>
  
  <pre><code>var answers  = ["i am fine, thank you!"];
  
      if(questions.indexOf(input ) &gt; -1){
          $('#output').html(answers[0]);
      }
  </code></pre>