This notebook demonstrates how to access time values from a nested data structure where an array contains objects with date keys and time arrays.
If you know the specific date keys, you can access the time arrays directly.
If you don't know the date keys in advance, you can extract them dynamically.
If you want to map all times from all dates, you can use nested loops or array methods.
Let's create a more user-friendly schedule format.
Let's create a function to find available time slots for a specific date.
Let's create a function to filter time slots based on a time range.
This notebook has demonstrated several methods to access and manipulate the time fields in your nested data structure:
times[0]['2025-03-10']
Object.keys()
to discover date keysThe key insight is understanding that your data structure is an array containing objects, where each object has date strings as keys and arrays of time strings as values. To access the time arrays, you need to:
times[0]
times[0]['2025-03-10']
For more complex operations, you can use JavaScript's array methods and object manipulation functions as demonstrated above.