title: How to convert JS Object to Array
body: <p>I need to convert a hash map </p>
  
  <pre><code>{ 
      "fruit" : ["mango","orange"],
      "veg"   : ["carrot"]
  } 
  </code></pre>
  
  <p>to </p>
  
  <pre><code>[ 
    { "type" : "fruit" , "name" : ["mango","orange"] } ,
    { "type" : "veg" ,   "name" : ["carrot"] } 
  ]
  </code></pre>
  
  <p>how do I do that??</p>