a -> isAdmin
b -> isActive
const isDeletableUser = !isAdmin && isActive; return isDeletableUser;
Point is for me that booleans with readable names shows how eliminating ifs becomes not only doable but arguably preferable.
a -> isAdmin
b -> isActive
(Better would be naming the function "isDeletableUser" instead of the intermediate const, but was keeping with the original.)Point is for me that booleans with readable names shows how eliminating ifs becomes not only doable but arguably preferable.