Created
January 12, 2016 15:34
-
-
Save chuck0523/011a61eaa4dd2b8a8cec to your computer and use it in GitHub Desktop.
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
num_array = [].fill(0, 0, 5) | |
puts num_array # [0, 0, 0, 0, 0] | |
str_array = [].fill('A', 0, 5) | |
puts str_array # ['A', 'A', 'A', 'A', 'A'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment