title: Get values from dynamic string array in Typescript
body: <p>In angular material form, I have a field with mat-option which contains list of options(i.e., a, b, c, d, e). When user selects/unselects one particular option(i.e., c), I need to do some manipulation. 
  But I am getting undefined error, even if I select an option 'c' without selecting any other option. </p>
  
  <p>I can understand that it is due to the index value[2] that I have used. I am not sure on how to identify if the user selects option 'C' or not Since it's index value may increase or decrease dynamically based on user selection.</p>
  
  <p>Response array may look like:</p>
  
  <pre><code>value = {'d','c'} or value = {'c','b','a'} or value = {}
  
  if(value[2] === 'c') {
     console.log('c');
   } 
  </code></pre>
  
  <p>Can someone help me to write typescript code?</p>