title: Javascript const coming up as undefined and not undefined in chrome dev console
body: <p>I have a const <code>newProducts</code> that is returning <code>undefined</code> and yet says it isn't undefined in the chrome dev console:
  <a href="https://i.stack.imgur.com/6o42t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6o42t.png" alt="enter image description here"></a></p>
  
  <p>It says it is defined in the yellow highlighted text in the console, and undefined when hovering over it. It shouldn't be undefined. I have stepped through the code and the <code>returns</code> inside the <code>map</code> are returning values. Why is this <code>const</code> coming up <code>undefined</code> and also not <code>undefined</code>?</p>
  
  <p><strong>searchResults.reducer.js</strong></p>
  
  <pre><code>// @flow
  import initialState from '../../config/config'
  import {
    FETCH_PRODUCTS_REJECTED,
    UPDATE_SEARCH_RESULTS
  } from '../search-page/searchPage.action'
  import { SET_SELECTED_SHOP } from '../search-results/searchResults.action'
  
  const searchResults = (
    initialResultsState: [] = initialState.get('searchResults'),
    action: Object): string =&gt; {
    switch (action.type) {
      case UPDATE_SEARCH_RESULTS: {
        const newProducts = action.payload.products.map(product =&gt; {
          return {
            shop: {
              id: product.shop[0].f1,
              name: product.shop[0].f2,
              coordinate: {
                latitude: product.shop[0].f4,
                longitude: product.shop[0].f3
              },
              selected: false
            },
            products: product.products
          }
        })
        return initialResultsState.set('products', newProducts)
      }
      case SET_SELECTED_SHOP: {
        const newProducts = initialResultsState.get('products').map(product =&gt; {
          if (product.shop.id === action.payload) {
            return {
              shop: {
                ...product.shop,
                selected: true
              },
              products: product.products
            }
          } else {
            return {
              shop: {
                ...product.shop,
                selected: false
              },
              products: product.products
            }
          }
        })
        return initialResultsState.set('products', newProducts)
      }
      case FETCH_PRODUCTS_REJECTED: {
        console.log('there was an issue getting products: ',
          action.payload)
        return initialResultsState
      }
      default:
        return initialResultsState
    }
  }
  
  export default searchResults
  </code></pre>