title: Getting null in values from Promise.all
body: <p>I am using promises. This is in continuation to my question <a href="https://stackoverflow.com/questions/42127919/return-promises-instead-of-async">here</a></p>
  
  <p>The issue I am having is that in response, i.e. an array of objects is having null values. I will try to explain this </p>
  
  <ol>
  <li>First I get the userId</li>
  <li>Get user whishlist products from the userId</li>
  <li>Then using userId I get stores/shop list</li>
  <li>Then I iterate over store list and call another API to check if this store is user favourite store.</li>
  <li><p>Then I get the products of each store and append in an object and return.</p>
  
  <pre><code>function getStoresList(context) {
      const userID = common.getUserID(context)
      let userWishListProd = []
  
      return userID
          .then(uid =&gt; Wishlist.getUserWishlistProducts(uid).then((products) =&gt; {
              userWishListProd = products.data.map(product =&gt; +product.id)
              return uid
          }))
          .then(uid =&gt; api.getOfficialStoresList(uid).then((response) =&gt; {
                  if (!response.data) {
                      const raw = JSON.stringify(response)
                      return []
                  }
  
                  const shops = response.data
                  return Promise.all(
                          shops.map((shop) =&gt; {
                              const id = shop.shop_id
                              const shopobj = {
                                  id,
                                  name: shop.shop_name,
                              }
                              return favAPI.checkFavourite(uid, id)
                                  .then((favData) =&gt; {
                                      shopobj.is_fave_shop = favData
  
                                      // Fetch the products of shop
                                      return getProductList(id, uid)
                                          .then((responsedata) =&gt; {
                                              shopobj.products = responsedata.data.products.map(product =&gt; ({
                                                  id: product.id,
                                                  name: product.name,
                                                  is_wishlist: userWishListProd.indexOf(product.id) &gt; -1,
                                              }))
                                              return shopobj
                                          })
                                          .catch(() =&gt; {})
                                  })
                                  .catch(err =&gt; console.error(err))
                          }))
                      .then(responses =&gt; responses)
                      .catch(err =&gt; console.log(err))
              })
              .catch(() =&gt; {}))
          .catch()
  }
  </code></pre></li>
  </ol>
  
  <p>The response I get is </p>
  
  <pre><code>[{
          "id": 1001,
          "name": "Gaurdian Store",
          "is_fave_shop": "0",
          "products": [{
              "id": 14285912,
              "name": "Sofra Cream",
              "is_wishlist": false
          }]
      },
      null,
      null,
      {
          "id": 1002,
          "name": "decolite",
          "is_fave_shop": "1",
          "products": [{
              "id": 14285912,
              "name": "Denca SPF",
              "is_wishlist": false
          }]
      }
  ]
  </code></pre>
  
  <p>The actual store are coming as 4 but instead of it null gets appended. What is wrong I am doing with Promises here.</p>