title: How to fix the findIndex in angular
body: <pre><code>DATA = {
   code: 'no1',
   name: 'Room 1',
   room: {
    id: 'num1',
    class: 'school 1'
   }
  };
  
  LIST = [{
      code: 'no1',
      name: 'Room 1',
      room: {
          id: 'num1',
          class: 'school 1'
      }
  }, {
      code: 'no2',
      name: 'Room 2',
      room: {
          id: 'num3',
          class: 'school 2'
      }
  }, {
      code: 'no3',
      name: 'Room 3',
      room: {
          id: 'num3',
          class: 'school 3'
      }
  }]
  </code></pre>
  
  <p><code>LIST.filter((x: any) =&gt; DATA.room.findIndex(y =&gt; y['id'] === x['id']) &gt; -1);</code></p>
  
  <p>How to fix the <code>data.room.findIndex is not a function</code>?</p>
  
  <p>I have LIST here which it will list all the data and DATA which is the current selected data.
  What I'm trying to do is to filter the data where it equal to the <code>DATA</code>.</p>