I have an array
let availabilityArray = [currentYearAvailability, previousYearAvailability, previousLastYearAvailability]
console.log(availabilityArray)
when I Console, I can able to find what is available what is not available
const preAuthAvailabilityYears =
[
currentYearAvailability ? currentYear : undefined,
previousYearAvailability ? previousYear : undefined,
previousLastYearAvailability ? previousLastYear : undefined,
]
I need only the availability years to be displayed in the array instead showing as undefined as third argument, If it is undefined i shouldnot should in array