-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Karthikeyan A K
committed
Jan 27, 2016
1 parent
f79b4bd
commit 022efca
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# array_copy.rb | ||
|
||
def array_changer array | ||
array << 6 | ||
end | ||
|
||
some_array = [1, 2, 3, 4, 5] | ||
p some_array | ||
array_changer Marshal.load(Marshal.dump(some_array)) | ||
p some_array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# array_passed_to_function.rb | ||
|
||
def array_changer array | ||
array << 6 | ||
end | ||
|
||
some_array = [1, 2, 3, 4, 5] | ||
p some_array | ||
array_changer some_array | ||
p some_array |