Question

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

Was it helpful?

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top