title: Why would my find method return undefined?
body: <p>I'm recreating a number of Underscore.js methods to study JavaScript and programming in general.</p>
  
  <p>Below is my attempts to recreate Underscore's <code>_.find()</code> method.</p>
  
  <pre><code>var find = function(list, predicate) { // Functional style
      _.each(list, function(elem){
          if (predicate(elem)) {
              return elem;
          }
      });
  };
  
  var find = function(list, predicate) { // Explicit style
      if (Array.isArray(list)) {
          for (var i = 0; i &lt; list.length; i++) {
              if (predicate(list[i])) {
                  return list[i];
              }
          }
      } else {
          for (var key in list) {
              if (predicate(list[key])) {
                  return list[key];
              }
          }
      }
  };
  </code></pre>
  
  <p>My second <code>find</code> method, which is using <code>for</code> loop and <code>for in</code> loop works. Whereas, my first <code>find</code> method would return <code>undefined</code>. I believe both should do the same work. However, they don't. Would someone please point what is going on?</p>