JavaScript Truthy and Falsy  Quiz

Test your JavaScript Truthy and Falsy Understanding

JavaScript Quiz #06 - Truthy and Falsy Values

4 mins read

1. What is the output?

console.log(!!"0");

2. What is the output?

 var x = " ";
console.log(Boolean(x));

3. What is the output?

 console.log(Boolean(Symbol()));

4. Which of the following values is considered falsy in JavaScript?

5. What is the output?

console.log(0 || "Hello" && (null ?? true)); 

6. What is the output?

 console.log("" === false);

7. What is the output?

 console.log(Boolean(-42));

8. What is the output?

 let obj = {
prop1: {
prop2: null
}
};

console.log(obj.prop1?.prop2 ?? "Default value");

9. What is the output?

  console.log(Boolean(-0))