I have an object in javascript that looks like this:
const inventory = {
fall: { 'Category 1': [], 'Category 2': [] },
spring: { 'Category 1': [], 'Category 3': [] },
winter: { 'Category 3': [], 'Category 4': [] },
summer: { 'Category 4': [], 'Category 5': [] }
}
How can I sort by keys so that those are ordered as follows:
- spring
- summer
- fall
- winter