title: FLOW: how to make Flow work with callback for Array.prototype.find()
body: <p>Guys I'm new to Flow. </p>
  
  <p>I have this code</p>
  
  <pre><code>type importItem = {
    name: string,
    groupRank: number,
    rank: number,
    node: Object,
  };
  function findTargetImportItem(importedItems: Array&lt;importItem&gt;, outOfOrderItem: importItem) : importItem {
  
  return importedItems.find((importedItem: importItem) =&gt; importedItem.rank &gt; outOfOrderItem.rank);}
  </code></pre>
  
  <p>I got this error </p>
  
  <pre><code>Cannot return importedItems.find(...) because undefined [1] is incompatible with importItem [2].
  
       src/rules/import-order.js
   [2]  74│ function findTargetImportItem(importedItems: Array&lt;importItem&gt;, outOfOrderItem: importItem) : importItem {
        75│   /**
        76│      * Return the import where the unordered imports will be moving towards
        77│      */
        78│   return importedItems.find((importedItem: importItem) =&gt; importedItem.rank &gt; outOfOrderItem.rank);
        79│ }
        80│
        81│ function hasTrailingSpace(sourceCode, node) {
  
       /private/tmp/flow/flowlib_21840530/core.js
   [1] 244│     find(callbackfn: (value: T, index: number, array: Array&lt;T&gt;) =&gt; any, thisArg?: any): T | void;
  </code></pre>
  
  <p>I don't know how to make Flow know that the stuff returned by the find helper function is an importItem type. </p>
  
  <p>Can you guys help me with this</p>