I have an object that looks like this:
steps: {
'36793745-4c52-42d2-91a5-dcdc9de2e8fa': [],
'b23d8770-806f-44a9-aa2e-a21dd68f7977': [],
'33571d58-b833-4a7d-a1a1-ec96366cb74a': [],
'b1499917-7f82-49e5-9708-6237340a9610': []
}
Each array within that object can be an array of strings.
I'd like to check if any of those arrays have an item, if they do, I like to return true.
I do not care about checking any after, as soon as one returns true, I am happy.
I tried something like Object.keys(steps).map(step => steps[step].length > 0) but this returns an array of true or false [false, false, false, false]
I then tried Object.keys(steps).filter(step => steps[step].length > 0) but this returns an array of the item keys that do have a value.
I know at this point I could simply check the length of the result but I was wondering if there is a better way to achieve this.
This object could potentially grow in size considerably, so I was hoping for some sort of early exit as soon as I get a true