Ruby/Array/select
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
Which of these numbers are less than the target?
ceiling = 50 p [1, 10, 49, 50.1, 200].select { |x| x < ceiling } # => [1, 10, 49]
Личные инструменты |
ПросмотрыRuby/Array/selectМатериал из Wiki.crossplatform.ruВерсия от 17:10, 26 мая 2010; (Обсуждение)
Which of these numbers are less than the target?ceiling = 50 p [1, 10, 49, 50.1, 200].select { |x| x < ceiling } # => [1, 10, 49] |