Bird
0
0

In Ruby, which of the following values is considered falsy?

easy📝 Conceptual Q11 of 15
Ruby - Operators and Expressions
In Ruby, which of the following values is considered falsy?
A<code>false</code>
B<code>0</code>
C<code>""</code> (empty string)
D<code>[]</code> (empty array)
Step-by-Step Solution
Solution:
  1. Step 1: Recall Ruby falsy values

    In Ruby, only false and nil are falsy.
  2. Step 2: Check each option

    0, empty string, and empty array are all truthy in Ruby.
  3. Final Answer:

    false -> Option A
  4. Quick Check:

    Falsy = false or nil [OK]
Quick Trick: Only false and nil are falsy in Ruby [OK]
Common Mistakes:
  • Thinking 0 is falsy like in some other languages
  • Assuming empty string is falsy
  • Confusing empty array with falsy

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Ruby Quizzes