toggle boolean with if statement I currently I have this code
if (this.showAllOnlineFriends === false) {
  this.showAllOnlineFriends = true;
} else {
  this.showAllOnlineFriends = false;
}

When you press a button, it will toggle a boolean on or off. Is there a more readable way to write this?
Value flipping is traditionally just done with a negation:
this.showAllOnlineFriends = !this.showAllOnlineFriends

That is a common, good practice way to do it. It is highly recognizable and easy to understand