mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
docs for creating arrays
* array.c: [DOC] add example for Array.new with block and index. Reported by Don Cruickshank. [ruby-core:68442] [Bug #10944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
719262eeda
commit
56abb1cdd8
1 changed files with 2 additions and 1 deletions
1
array.c
1
array.c
|
@ -5927,6 +5927,7 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary)
|
||||||
* other arrays:
|
* other arrays:
|
||||||
*
|
*
|
||||||
* Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
|
* Array.new(4) { Hash.new } #=> [{}, {}, {}, {}]
|
||||||
|
* Array.new(4) {|i| i.to_s } #=> ["0", "1", "2", "3"]
|
||||||
*
|
*
|
||||||
* This is also a quick way to build up multi-dimensional arrays:
|
* This is also a quick way to build up multi-dimensional arrays:
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue