Guest User

Untitled

a guest
Nov 17th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. def array_copy(source)
  2. destination = []
  3. for number in source
  4. # Add number to destination if number
  5. # is less than 4
  6. destination << number if number < 4
  7. end
  8. return destination
  9. end
  10.  
  11. def array_copy(source)
  12. return source.select {|i| i < 4}
  13. end
Add Comment
Please, Sign In to add comment