title: Javascript object's function returns undefined or always false?
body: <p>Okay, so I'm pretty sure I'm just dumb as hell as I'm new to javascript.
  Tried to finde anything, but didn't. Probably because I don't know at all what I could be looking for.</p>
  
  <p>I got an array filled with different data. I think they're all stored as strings, as I get them from a XMLHttpRequest of a website's search.</p>
  
  <pre><code>var search = document.getElementById("filter").value;
  var xhr = new XMLHttpRequest();
  xhr.open('GET', "https://api.soundcloud.com/tracks?client_id=1dff55bf515582dc759594dac5ba46e9&amp;q=" + search, false);
  xhr.addEventListener("load", function() {
      var searchString = xhr.response;
  
      searchArray = searchString.split(",");
  </code></pre>
  
  <p>I then try to store some of the array's data in an object's different porperties. For one of the properties, I try to check two places in the array and compare then. For some reason it won't work:</p>
  
  <pre><code>track01  = 
  {..., usable:function(){if(searchArray[37] === "true" &amp;&amp; searchArray[19] === "all"){return true;}else{return false;}}, ...};
  </code></pre>
  
  <p><strong>This always returns false, even if it should be true.</strong></p>
  
  <p><em>I also tried it with == or without the quotation marks. (On either side and both sides)</em></p>
  
  <p>Another thing I tried was to get rid of the if / else:</p>
  
  <pre><code>track01  = 
  {..., usable:function(){searchArray[37] == "true" &amp;&amp; searchArray[19] == "all"};
  </code></pre>
  
  <p><strong>This always returns undefined for some reason.</strong></p>
  
  <p>To be clear: searchArray[37] is a string with the content "true" and searchArray[19] a string with the content "all". At least in the case I'm testing.</p>
  
  <p>I hope this isn't as dumb as I think it is.</p>