Why ever would one want to use the Not operator?

I’m just wondering why anyone would choose to use a Not operator when as far as I can tell the normal operators can do the same thing.

Why not? It’s simple:

if (!boolvar) {
    //Do stuff if boolvar is false
}

is easier than

if (boolvar) {} else {
    //Do stuff if boolvar is false 
}
1 Like