Skip to main content
!! usage
Source Link
Dave Newton
  • 160.5k
  • 27
  • 263
  • 310

A ! negates an expression.

In your example, if loadDynamicBlock() returned true, the function calling it would return false, and vice-versa: !true == false

It can also be used to create actual booleans from JavaScript's ideas of truthy and falsy.

var a = 5; !!(a - 5) === false; !!(a + 5) === true; 

A ! negates an expression.

In your example, if loadDynamicBlock() returned true, the function calling it would return false, and vice-versa: !true == false

A ! negates an expression.

In your example, if loadDynamicBlock() returned true, the function calling it would return false, and vice-versa: !true == false

It can also be used to create actual booleans from JavaScript's ideas of truthy and falsy.

var a = 5; !!(a - 5) === false; !!(a + 5) === true; 
added 12 characters in body
Source Link
Dave Newton
  • 160.5k
  • 27
  • 263
  • 310

A ! negates an expression. If

In your example, if loadDynamicBlock() returnsreturned true, this function (the one with the return statement) willfunction calling it would return false, and vice-versa.: !true == false

A ! negates an expression. If loadDynamicBlock() returns true, this function (the one with the return statement) will return false, and vice-versa.

A ! negates an expression.

In your example, if loadDynamicBlock() returned true, the function calling it would return false, and vice-versa: !true == false

added 2 characters in body
Source Link
Dave Newton
  • 160.5k
  • 27
  • 263
  • 310

Negates theA ! negates an expression, so if. If loadDynamicBlock() returns true, this function (the one with the return statement) will return false, and vice-versa.

Negates the expression, so if loadDynamicBlock() returns true, this function (the one with the return statement) will return false, and vice-versa.

A ! negates an expression. If loadDynamicBlock() returns true, this function (the one with the return statement) will return false, and vice-versa.

added 38 characters in body
Source Link
Dave Newton
  • 160.5k
  • 27
  • 263
  • 310
Loading
Source Link
Dave Newton
  • 160.5k
  • 27
  • 263
  • 310
Loading