I have this loop that iterates and assigns a variable to true depending on the different conditions
for (const element of actionsReferences) {
if (element === 'accept') {
this.showAcceptButton = true
} else if (element === 'reject') {
this.showRejectButton = true
} else if (element === 'transfer') {
this.showTransferButton = true
}
}
How can i get the same result by avoiding if () ?
showXButtonvariables indicate a deeper code stink. You might want to show more of your code so that the core issue can be fixed. \$\endgroup\$