I'm confused on how the spread operator is being used here. I have a basic understanding of how the spread operator works but I'm confused on what the spread operators are referring to, how it is being used, and what it is offering. The "userCanDecline" const is a boolean retrieved from an above call. Please let me know if I can provide any more information about what I've shared.
return [
...(userCanDecline
? [
{
label: 'Decline Draw',
icon: 'ban',
action: () => (el, ev) => {
Service.decline(this.onCloseView);
},
},
]
: [])