- See more at: http://blogtimenow.com/blogging/automatically-redirect-blogger-blog-another-blog-website/#sthash.YsVbCxL0.dpuf Journey to Becoming a Web Developer: Arrays and Hashes

Tuesday, October 22, 2013

Arrays and Hashes

Hello all.  Today I have been learning about arrays and hashes on Code Academy.  Arrays and Hashes are used to store things. We can access the things in the arrays and hashes by using an index. Indexes in arrays start at 0. Indexes in arrays can be accessed by the key. Hashes are made up of key-value pairs (ex. pet => "Ben"). We can create empty hashes by using Hash.new. I also learned how to use the .each iterator with a hash. The syntax look like this: name_of_hash.each {|x| action}.  That's what I've learned so far today. Tomorrow I hope to continue learning Ruby on Code Academy and Treehouse.

No comments:

Post a Comment