Skip to content
Advertisement

How to get opposite boolean value of variable in Javascript

var a = true;

How to get opposite value of a (false) and vice versa?

Advertisement

Answer

>>> a = true;
true
>>> !a;
false
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement