title: underscore js findWhere find object with just key value
body: <p>I have an array that lists all users, and each new connection gets added to this array along with the file name they uploaded. An example after two people have uploaded a file each is: </p>
  
  <pre><code>[ '{ 127.0.2.2: test.pdf}', '{ 127.0.0.1: asf.pdf}' ]
  </code></pre>
  
  <p>How would I return the file name with just the IP? If needed, I can split the file name later if returning the IP + file name works.</p>
  
  <p>I've tried:</p>
  
  <pre><code>console.log(_.findWhere(userlist, function(){ var tempObj = {}; return tempObj[user] = fileName;}));
  </code></pre>
  
  <p>But this just returns the first value, every time. Using the example, it would return {127.0.2.2: test.pdf} every time. user and fileName are defined after someone uploads, so they should overwrite with the current information (which is proven right, as it adds it correctly), but it still just returns the first key/value pair every time.</p>
  
  <p>Let me know if this makes sense.</p>