A simple way to accomplish what (I think) you want is to add an additional overlay property, e.g., my-overlay
, to each of the set of overlays. Then you need test only for that property, since all of them will have it. No need to test each overlay separately for a different property.
E.g., a given overlay would have, say, property ov-two
, but it would also have property my-overlay
. Another overlay would have, say, property ov-three
, but it too would also have property my-overlay
.
This is a pretty standard approach, IMO.
Note that if you do this you do not also need to keep a separate list of your overlays. (But nothing precludes you from doing that also.) Just as creating a list is one way to record a set, so is putting properties on an object a way to record a set: namely, the objects that have that property.