irb(main):001:0> a = [] => [] irb(main):002:0> a1 = [1, 2] => [1, 2] irb(main):003:0> a2 = [3, 4] => [3, 4] irb(main):004:0> a.push a1 => [[1, 2]] irb(main):005:0> a.push a2 => [[1, 2], [3, 4]] irb(main):006:0> a => [[1, 2], [3, 4]] irb(main):007:0> a[0] => [1, 2] irb(main):008:0> a[0][1] => 2
Related Posts:
- What does %w(array) mean?
- Array to Hash Ruby
- Ruby: undefined method `[]’ for nil:NilClass when trying to get Enumerator on an Array of Hashes
- How to map with index in Ruby?
- How to sum array of numbers in Ruby?
- Ruby array to string conversion
- How to check if a value exists in an array in Ruby
- What is the “right” way to iterate through an array in Ruby?
- Difference between map and collect in Ruby?
- What is the best way to convert an array to a hash in Ruby
- How can I delete one element from an array by value
- Get underlined text with Markdown
- What is the meaning of *nix?
- Get underlined text with Markdown
- How do I declare a 2d array in C++ using new?
- What does the “map” method do in Ruby?
- How to print the array?
- How do I declare a 2d array in C++ using new?
- How can I create a two dimensional array in JavaScript?
- How can I create a two dimensional array in JavaScript?
- How to write a switch statement in Ruby
- Rails 5 ActionController::InvalidAuthenticityToken error
- what does ? ? mean in ruby
- How to update Ruby Version 2.0.0 to the latest version in Mac OSX Yosemite?
- warning: ISO C++ forbids variable length array
- Passing a 2D array to a C++ function
- Create 3D array using Python
- How do I do a deep copy of a 2d array in Java?
- How to use “gets” and “gets.chomp” in Ruby
- Getting a substring in Ruby by x number of chars
- How to have an array of arrays in Python
- How to check whether a string contains a substring in Ruby
- Ruby: How to install a specific version of a ruby gem?
- ruby operator “=~” [duplicate]
- Understanding NumPy’s einsum
- What does << mean in Ruby?
- What is attr_accessor in Ruby?
- ActionController::UnknownFormat
- What does ||= (or-equals) mean in Ruby?
- How to read lines of a file in Ruby
- Java Comparator class to sort arrays
- PHP multidimensional array search by value
- Ruby equivalent for Python’s “try”?
- What does “+=” (plus equals) mean?
- Rails 4 RoutingError: No Route Matches
- Using numpy to build an array of all combinations of two arrays
- Multidimensional Vectors in C++
- undefined method (NoMethodError) ruby
- Multi-Line Comments in Ruby?
- How to uninstall ruby installed by ruby-install
- Multi-dimensional arrays in Bash
- PG::ConnectionBad – could not connect to server: Connection refused
- Rails syntax error : unexpected keyword_ensure, expecting end-of-input
- Removing all installed Gems and starting over
- Getting the array length of a 2D array in Java
- Can I create an Array of Char pointers in C?
- Ruby `send` vs `call` method
- What is the meaning of “do | |” in Ruby?
- RVM is not a function, selecting rubies with ‘rvm use …’ will not work
- How to delete specific characters from a string in Ruby?
- Ruby: kind_of? vs. instance_of? vs. is_a?
- Rails: I installed Ruby, now “bundle install” doesn’t work
- How to do a newline in output
- Ruby: What is the easiest way to remove the first element from an array?
- Ruby String to Date Conversion
- p vs puts in Ruby
- Determining type of an object in ruby
- Create a two dimensional string array anArray[2][2]
- Fizz Buzz in Ruby for dummies
- How to Uninstall RVM? [duplicate]
- Convert a 1D array to a 2D array in numpy
- What is the difference between a Process’ pid, ppid, uid, euid, gid and egid?
- Equivalent of “continue” in Ruby
- How to Sort a Multi-dimensional Array by Value
- What does the Ruby method ‘to_sym’ do?
- How to sort 2 dimensional array by column value?
- Array to Hash Ruby
- How to get rows and columns count of a 2D array in Java?
- Ruby 2.0.0p0 IRB warning: “DL is deprecated, please use Fiddle”
- Getting error: dyld: Symbol not found: _clock_gettime
- Uninstall old versions of Ruby gems
- Uploading a file in Rails
- What is java interface equivalent in Ruby?
- Sort hash by key, return hash in Ruby
- GCC: Array type has incomplete element type
- Multidimensional Arrays lengths in Java
- Gem installation error: You have to install development tools first
- How to understand strptime vs. strftime
- How to break out from a ruby block?
- ERROR: While executing gem … (Gem::FilePermissionError)
- No such file or directory @ rb_sysopen ruby
- How to add to an existing hash in Ruby
- Ruby ‘require’ error: cannot load such file
- How to convert a string to lower or upper case in Ruby
- What is the canonical way to trim a string in Ruby without creating a new string?
- Difference between $stdout and STDOUT in Ruby
- No implicit conversion of String into Integer (TypeError)?
- Multi-Line Comments in Ruby?
- TypeError: Invalid dimensions for image data when plotting array with imshow()
- List of Arrays in Java