At the moment, I am attempting to examine an array in order to determine if only one of its elements contains data. Consider this sample array:
playersByGender = {
mens: [],
womens: [],
other: []
};
Any combination of these elements may contain data, with just one being filled out. Is there a way to check all three and generate a boolean value indicating if only one is populated?
I initially considered using a foreach loop, but it seems that this method cannot be applied directly to an object.
Any assistance or suggestions would be greatly appreciated. Thank you!