Mar 17
Ruby Arrays. Hashes and Ranges (Part 2)
Using that same example we will learn some of the basics of array’s and how they are used in our learning rails as a more of visual example. Each ingredient listed above in the recipe has a unique key assignment and that is very useful when you want to address one and only one specific element of the list. The first element of an array is always has the position “0″ so when you say Spaghetti_sauce[0], you get “ground pork” and so is the same with the many other elements. Assigning a key gets you that element and allows you to see the contents of that particular element.
More on Arrays in the next post.
Comments are off for this post
