What does `!!value` do in JavaScript?

JavaScript Professional Easy

JavaScript Professional — Easy

What does `!!value` do in JavaScript?

Key points

  • Using `!!value` is a quick way to convert any value to a boolean.
  • The double negation ensures that the final result is always a boolean value.
  • This technique is often used in conditional statements to check the truthiness of a value.

Ready to go further?

Related questions