"items": {"hotdrinks": [ {"id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f","price": 20,"name": "Tea","img": "../assets/img/HotDrinks/1_udupibhavan.jpg" }, {"id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f","price": 25,"name": "Coffee","img": "../assets/img/Hot Drinks/2_udupibhavan.jpg" }, {"id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f","price": 50,"name": "Hot Milk","img": "../assets/img/Hot Drinks/3_udupibhavan.jpg" }, {"id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f","price": 70,"name": "Horlicks","img": "../assets/img/Hot Drinks/4_udupibhavan.jpg" }, {"id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f","price": 80,"name": "Badam Milk","img": "../assets/img/Hot Drinks/5_udupibhavan.jpg" }],
}
json i want to achieve using javascript. im just new to handling arrays and objects. thanksfound the answer given by Jeeva which works perfectlyfuture answers are welcome since we can know diffferent methods to achieve the same json object
dataArray = [ {title:"Hotdrinks", content: [{"id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f","price": 20,"name": "Tea","img": "../assets/img/HotDrinks/1_udupibhavan.jpg" }, {"id": "9aa113b4-1e4e-4cde-bf9d-8358fc78ea4f","price": 80,"name": "Badam Milk","img": "../assets/img/Hot Drinks/5_udupibhavan.jpg" }]}