Ruby - Operators and Expressions
Given the array
arr = [false, nil, 0, "", [], true], which Ruby code snippet correctly filters out falsy values?arr = [false, nil, 0, "", [], true], which Ruby code snippet correctly filters out falsy values?false and nil are falsy; all other values are truthy.select { |v| v } keeps elements where v is truthy.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions