DEV Community

es404020
es404020

Posted on

2 1

Ruby Arrays

Array is a container made up of rows and col .In which every row and col denote a unique position in the container .Take for instance a prison .Each cell(col) in a prison belong to a block (row) which can be uniquely identified.

In ruby array are denote as

a = [1,3,4,6,7,8]


Enter fullscreen mode Exit fullscreen mode

Ruby also have a lot of function to manipulate an array .To make this blog interesting let make it a quiz.

Quiz
a.length-
a.last
a.first
a.select {|number| number.odd?}
a.joint("-")
a.split(" ")
%w{"my name is eniola ajani solomon")

Array loop

each

a.each do |value|
     puts value 
end



Enter fullscreen mode Exit fullscreen mode

for


for i in a 
   puts i
end 

```

`
To get more array method

```
a.methods
```
Thanks for reading 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more