Question

How puts variable in iterators code Ruby EX: (1,2,3).select { |v| puts v > 2}

Était-ce utile?

La solution

Seems syntax error, I think you want something like this

[1,2,3].select { |v| puts v > 2 }

output would be :

false

false

true

Take a look here

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top