I\'m trying to learn JavaScript by going through some code in an application and I keep seeing !variable in if conditions. For example:
!variable
if (!va
It is a negation operator used for truth tests on a variable.
var myVariable = 1; if ( ! myVariable ) { // myVariable evaluates as false } if ( myVariable ) { // myVariable evaluates as true }