I'm trying to achieve a condition as in Case 1 which works ok. Is the Case 2 similar? Is there any other better way to write this condition?
Case 1:
if (selectedItem === 'firstName' || selectedItem === 'lastName') {
...
}
Case 2:
if (selectedItem === ('firstName' || 'lastName')) {
...
}