Javascript Meaning Of Double Exclamation Mark
Exclamation mark exclamation point bang shriek or pling although not the most common use of a logical operator in javascript the double bang or double exclamation mark recently.
Javascript meaning of double exclamation mark. I documented this on my blog for quick reference as i keep running into it. Double bang or double exclamation operator or not null assertion operator is used with variables if you are sure that the value will be always non null if a value is null and if we are using not null assertion operator it will throw one null pointer exception so we should use this operator only if we want to throw one exception always if any null value found. If you have ever noticed a double exclamation mark in someone s javascript code you may be curious what it s for and what it does.
Actually it is two operators right next to each other. So you re converting a value to a boolean then inverting it then inverting it again. The double exclamation mark in javascript basically means convert to boolean invert then invert again.
What does the double exclamation mark mean. Typeof javascript static javascript is not a static language rather it is a dynamic language. Think of it.
Placed in front of a boolean value it will reverse the value returning the opposite. Is there even such an operator in javascript. It s short way to cast a variable to be a boolean true or false value.