Looking for help with handling empty arrays in an object:
productDetails: {
cislife: [],
prime: []
}
Is there a way to have null returned instead of an empty array if no values are available?
For example, I'd like to determine if either the 'cislife' or 'prime' array is empty and return null as the value. If 'prime' has values but 'cislife' does not, then I want to return the values for 'prime' and null for 'cislife'.
Any suggestions on how to tackle this issue?