Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def array_copy(source)
- destination = []
- for number in source
- # Add number to destination if number
- # is less than 4
- destination << number if number < 4
- end
- return destination
- end
- def array_copy(source)
- return source.select {|i| i < 4}
- end
Add Comment
Please, Sign In to add comment