Short-circuits conditionals

If you have to execute a function only if condition is true, you can use short-circuit.

// Instead of this
if (condition) {
    doSomething();
}

// You can use short-circuit
condition && doSomething();

Logical AND

In JavaScript, the logical AND operator will return true if both operands are true. It returns false in any other scenario. Here are a few simple examples:

true && true
// true
true && false
// false
false && false
// false

You can also read this

The :valid CSS pseudo-class

The :valid CSS pseudo-class represents any  <input> or other <form> element whose...

input:valid {
  background-color: powderblue;
}

How to block F12 key with jQuery

In this post, I will show you how to disable...

$(document).on("contextmenu",function(e){        
   e.preventDefault();
});