1document.getElementById("myBtn").addEventListener("dblclick", function() {
2 alert("Hello World!");
3});
1let a = null;
2const b = a ?? -1; // Same as b = ( a != null ? a : -1 );
3console.log(b); // output: -1
4//OR IF
5let a = 9;
6const b = a ?? -1;
7console.log(b); // output: 9
8
9//PS.,VERY CLOSE TO '||' OPERATION IN FUNCTION, BY NOT THE SAME
1console.log(!!navigator.userAgent.match(/MSIE 8.0/));
2// returns either true or false
3
1console.log(navigator.userAgent.match(/MSIE 8.0/));
2// returns either an Array or null
3