Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将变量放入迭代器代码 Ruby EX:(1,2,3).select { |v| puts v > 2}
(1,2,3).select { |v| puts v > 2}
似乎语法错误,我想你想要这样的东西
[1,2,3].select { |v| puts v > 2 }
输出将是:
false false true
看看这里