Guest User

Untitled

a guest
Apr 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. def dup(toto)
  2. a = []
  3. toto.each do |b|
  4. a << b
  5. end
  6. a
  7. end
  8.  
  9. dup([1,2,3])
  10.  
  11. =======
  12.  
  13. def dup(toto)
  14. a = toto.inject([]) do |sum, b|
  15. sum << b
  16. end
  17. end
  18.  
  19. dup([1,2,3])
Add Comment
Please, Sign In to add comment