My object looks like this:
{
sunday: {status: "open", opening_time: "11:30 am", closing_time: "12:00 pm"},
monday: {status: "close", opening_time: "", closing_time: ""},
tuesday: {status: "close", opening_time: "", closing_time: ""},
wednesday: {status: "close", opening_time: "", closing_time: ""},
thursday: {status: "close", opening_time: "", closing_time: ""},
friday: {status: "close", opening_time: "", closing_time: ""},
saturday: {status: "close", opening_time: "", closing_time: ""}
}
The current data is stored in a variable called var curr = 'friday'
. I want to retrieve only the friday
object from the collection, which is
friday: {status: "close", opening_time: "", closing_time: ""}
.
What would be the best approach to achieve this?