Q. What will the following code return?

Code:
let x = 0;
if (x) { console.log('true'); } else { console.log('false'); }
  • (A) true
  • (B) false
  • (C) undefined
  • (D) 0
πŸ’¬ Discuss
βœ… Correct Answer: (B) false
Explanation: 0 is falsy, so it prints 'false'.
Explanation by: Chandani
0 is falsy, so it prints 'false'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
91
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Chandani
Publisher
πŸ“ˆ
91%
Success Rate