Skip to content

Instantly share code, notes, and snippets.

@strangelittlemonkey
Created June 19, 2016 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strangelittlemonkey/1bc72bd86f7ad0b3ccd770b8f72bb8f0 to your computer and use it in GitHub Desktop.
Save strangelittlemonkey/1bc72bd86f7ad0b3ccd770b8f72bb8f0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
arr1 = [ 1, 2, 2 ]
arr2 = [ 0, 1, 3 ]
@arr3 = []
def array_push(arr)
arr.each do |element|
if ! @arr3.include?(element)
@arr3.push(element)
end
end
end
array_push arr1
array_push arr2
puts @arr3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment