I have an array that contains some of these 3 values: ['daily', 'monthly', 'yearly']
but sometimes the array only contains: ['monthly', 'daily']
and what I want is to get the minimum between these 3 values which is daily and if not there I want monthly and also if it's not there I want the yearly. How can I achieve that ?
if (array.includes('daily')) { /* DAILY */ } else if (array.includes('monthly')) { /* MONTHLY */ } else { /* YEARLY */ }