Added similar methods to .length (#18729)

pull/18765/merge
Shafrazi 2018-10-16 01:17:27 +05:30 committed by Quincy Larson
parent 4ca6ba510c
commit c07b6b5c84
1 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,16 @@ The .length method tallies the number of elements in your array and returns the
array.length
=> 5
```
This is also similar to .count and .size methods.
``` ruby
array.count
=> 5
```
``` ruby
array.size
=> 5
```
#### .first
The .first method accesses the first element of the array, the element at index 0: