Today we’re asking Arrays to talk about everyones favorite subject: themselves. #length || #size An array never gets offended when you ask about its weight. In fact, you can ask in different ways: musnts = [“listen”, “to”, “the”, “musnt’s”, “child”] musnts.length => 5 musnts.size => 5 Of course, if it were empty, those would return 0.… Continue reading , tell us more about yourself.
Let’s talk about how to access things in Arrays. # This can accept a single integer, which represents the index you wish to hit. Arrays are zero based, meaning that the “first” element is not in the “1” spot, but “0”. If the number is negative, it starts from the end of the array. invitation… Continue reading Stick ’em up! Get what you want out of Arrays.
There are a variety of ways to create an array. Literal Constructor Simply set a variable equal to  arya = [“Stark”, 7, “Thrones”] #=> [“Stark”, 7, “Thrones”] #new Use the #new method on Array. Array.new #=>  You can give this method a number to give it a size. Array.new(7) #=> [nil, nil,… Continue reading Let’s Make An [Array] Baby
This is a challenge to myself to go through and really dive in to learn more about all the Ruby methods that I never knew about or frequently forget exist. Welcome to my perpetual #TIL.