arr = [1, 3, 56, 7, 13 , 52]arr.delete_if() do |item| item > 7endputs arr
Standard input is empty
1 3 7
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!