title: How to check if it is a JsonArray or JsonObject in Javascript
body: <p>So my json data is something like the following,</p>
  
  <pre><code>{
    "amazon": []
  },
  {
    "flipkart": {
      "product_store": "Flipkart",
      "product_store_logo": "logo url",
      "product_store_url": "shop url",
      "product_price": "14999",
      "product_offer": "",
      "product_color": "",
      "product_delivery": "3-4",
      "product_delivery_cost": "0",
      "is_emi": "1",
      "is_cod": "1",
      "return_time": "10 Days"
    }
  },
  {
    "snapdeal": []
  }
  </code></pre>
  
  <p>So here I want to loop through each shop and check if it is a jsonarray(amazon) or jsonobject(flipkart) then delete those empty array. And add it to a new array.</p>
  
  <p>Just like the example all keys who have no values like amazon and snapdeal are arrays. And keys with values are jsonObject. I can't change the json.</p>
  
  <p>So I want to know how can I detect JSONObject and JSONArray...</p>
  
  <p>Thank you..</p>