NOT operator (!) returns true for false statements and false for true statements. - Javascript Operator

Javascript examples for Operator:Boolean Operator

Description

NOT operator (!) returns true for false statements and false for true statements.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var x = 6;/*from   w  ww .  j  av a 2  s . c o m*/
var y = 3;

document.getElementById("demo").innerHTML = !(x === y) + "<br>" + !(x > y);
</script>

</body>
</html>

Related Tutorials