title: Ignore undefined value in object using "for in" loop and IndexOf()
body: <p>So, i need to find every key / value in <code>searchSpace</code> object that contains substring in <code>query</code> string. For example, key is <code>3</code>, <code>value1: '123abc'</code>. And it should find every key / value that contains <code>query = '3'</code>. 
  This is my code: </p>
  
  <pre><code>for (let key in searchSpace) {
      if (key.toLowerCase().indexOf(query.toLowerCase()) !== -1 ||
      searchSpace[key].value1.toLowerCase().indexOf(query.toLowerCase()) !== -1 ||
      searchSpace[key].value2.toLowerCase().indexOf(query.toLowerCase()) !== -1) {
          // do something, not the case
      }
  }
  </code></pre>
  
  <p>It works. But my object should be able to contain <code>undefined</code> or <code>null</code> in <code>value</code>. Like this: </p>
  
  <pre><code>searchSpace['1'] = { value1: 'loremipsum', value2: '12345' };
  searchSpace['2'] = { value2: 'ABCD' }; // here, value1 is undefined
  searchSpace['3'] = { value1: '123abc', value2: 'ABCD' };
  </code></pre>
  
  <p>How to make my code ignore undefined values in <code>searchSpace</code> when i apply <code>IndeoOf()</code> or <code>toLowerCase()</code>?</p>