js double !! code example
Example 1: javascript operator double not
// convert to boolean
// The following examples are the only values which result in a false expression
!!0 // false
!!"" // false
!!null // false
!!undefined // false
!!NaN // false
Example 2: double javascript
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Numbers</h2>
<p>Numbers can be written with or without decimals:</p>
<p id="demo"></p>
<script>
var x = 3.14;
var y = 3;
document.getElementById("demo").innerHTML = x + "<br>" + y;
</script>
</body>
</html>