Prepare for the Salesforce JavaScript Developer Exam. Utilize comprehensive quizzes, flashcards, and multiple choice questions with hints and explanations. Boost your exam readiness!

Practice this question and more.


What is the output of the expression !!null;

  1. false true false

  2. false false true

  3. false true true

  4. true true false

The correct answer is: false false true

The expression !!null is a double negation of the value null. In JavaScript, the logical NOT operator `!` converts a value to its boolean equivalent and then negates it. When you apply the first negation `!null`, the null value is coerced to a boolean. Since null is a falsy value, `!null` evaluates to true. Then, applying the second negation with another `!`, you negate true, resulting in false. Thus, the final output of the expression !!null is false. This understanding aligns with the evaluation of its logical truthiness and the behavior of the NOT operator in JavaScript. Other choices do not accurately reflect the result of negating null twice.