From cecb7d9adfdac4979a8bb1d31be2a9d34a954691 Mon Sep 17 00:00:00 2001 From: Michael Kane Date: Mon, 19 Nov 2018 22:09:50 -0600 Subject: [PATCH] Add alternate way of creating array (#25379) --- guide/english/ruby/ruby-arrays/index.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/guide/english/ruby/ruby-arrays/index.md b/guide/english/ruby/ruby-arrays/index.md index 18c204eb01..d43404a71c 100644 --- a/guide/english/ruby/ruby-arrays/index.md +++ b/guide/english/ruby/ruby-arrays/index.md @@ -9,6 +9,12 @@ An array represents a list of values. The individual values are often called "el my_array = [1, 2, 3, 4, 5] ``` +You can also create an empty array by using the 'new' method in the 'Array' class: + +```ruby +my_array = Array.new +``` + That first example is an array of numbers, but a Ruby array can contain values of different types, even other arrays: ```ruby