I've searched extensively but still haven't found a suitable solution.
Currently, I have a JSON string that is being retrieved from the server. My goal is to convert this string into a JavaScript array in order to organize the data by "hotel_name," 'minPrice,' and 'hotel_star.'
Below is the JSON string:
{
"00001065": {
"hotel_id": "00001065",
"hotel_name": "The Infantry Hotel",
"hotel_star": "3",
"image": "",
"location": "Infantry Road",
"minPrice": "2,497",
"RoomTypes": [
{
"RoomTypeName": "Deluxe King / Twin Double",
"AvailableQuantity": "4",
"RatePlanInclusions": "Complimentary Wi-Fi Internet",
"price": "2,497"
},
{
"RoomTypeName": "Superior Double",
"AvailableQuantity": "2",
"RatePlanInclusions": "Breakfast",
"price": "3,496"
}
]
},
"00001080": {
"hotel_id": "00001080",
"hotel_name": "Hotel Ramanashree",
"hotel_star": "3",
"image": "",
"location": "Richmond Road",
"minPrice": "3,879",
"RoomTypes": [
{
"RoomTypeName": "Executive Room",
"AvailableQuantity": "25",
"RatePlanInclusions": "Breakfast",
"price": "3,879"
},
{
"RoomTypeName": "Club Room",
"AvailableQuantity": "25",
"RatePlanInclusions": "Breakfast",
"price": "4,604"
}
]
},
"00003757": {
"hotel_id": "00003757",
"hotel_name": "The Paul ",
"hotel_star": "5",
"image": "",
"location": "Domlur Layout",
"minPrice": "6,216",
"RoomTypes": [
{
"RoomTypeName": "Executive Suite - Two Bedrooms Suite",
"AvailableQuantity": "4",
"RatePlanInclusions": "Complimentary Wi-Fi Internet, Breakfast",
"price": "8,942"
},
{
"RoomTypeName": "Premier Suite - Two Bedrooms Suite",
"AvailableQuantity": "2",
"RatePlanInclusions": "Complimentary Wi-Fi Internet, Breakfast",
"price": "10,718"
},
{
"RoomTypeName": "Studio Suite - One Bedroom Suite",
"AvailableQuantity": "4",
"RatePlanInclusions": "Complimentary Wi-Fi Internet, Breakfast",
"price": "6,216"
}
]
}
}