title: Count length of JSON Object
body: <p>I have JSON which looks like this:</p>
  
  <pre><code>{
    "item1": {
      "category": "fruit",
  
    },
   "item2": {
      "category": "fruit",
  
    }
  }
  </code></pre>
  
  <p>How can I count the no. of items inside this?</p>