Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an exclamation point in JavaScript?

Tags:

javascript

What does an exclamation mark before a function do?

Example:

return !loadDynamicBlock();
like image 971
tmartin314 Avatar asked Nov 04 '11 15:11

tmartin314


People also ask

What is '!' In TypeScript?

What is the TypeScript exclamation mark? The non-null assertion operator tells the TypeScript compiler that a value typed as optional cannot be null or undefined . For example, if we define a variable as possibly a string or undefined, the ! operator tells the compiler to ignore the possibility of it being undefined.

What does exclamation point before variable mean in JavaScript?

! is a logic reversal operator, if something was true it will change it to false, if something is false, it will change to true. example, we know that empty string or 0 in boolean is false. let a = Boolean("") console. log(a) // shows false, because empty string in boolean is false console.

What does exclamation mark after mean in JavaScript?

The exclamation mark (non-null assertion) operator removes null and undefined from the type of an expression. It is used when we we know that a variable that TypeScript thinks could be null or undefined actually isn't.

What do (!) Mean?

The exclamation mark, !, or exclamation point (American English), is a punctuation mark usually used after an interjection or exclamation to indicate strong feelings or to show emphasis. The exclamation mark often marks the end of a sentence, for example: "Watch out!".


1 Answers

The ! in Javascript inverts a boolean expression.

like image 163
JaredPar Avatar answered Sep 19 '22 20:09

JaredPar