Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142353

How to determine if any arrays in an object has an entry

$
0
0

This is unlike most questions, which concern arrays of objects, not objects of arrays. I have a data structure such as the following, and I need to determine if any of the arrays contained by the object contain any values.

All I need is true/false if any of the arrays has at least one value. Please also consider effort in my (self-)answer.

let pendingAdditions = {
  hospitals: ['Silencio Hospital','St Judes'],
  licenses: ['poe-tic license'],
  medschools: []
} 

Viewing all articles
Browse latest Browse all 142353

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>