You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd suggest going with a positive isDog and negating it when necessary.
constisDog=(dog)=>dog.sound()==='bark'if(isDog(pet)){// handle a situation when pet is a dog}if(!isDog(pet)){// handle a situation when pet isn't a dog}
I rarely encounter a need for negative boolean variables, so please feel free to reference any examples you see fit.
Suggestion to explain the best approach for naming negative booleans.
Example: if you create a variable for checking if an object is a dog , you could either do:
or
The text was updated successfully, but these errors were encountered: