문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top