mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[DOC] add explanation for Array#sum
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a2f3069988
commit
8afd5857f0
1 changed files with 2 additions and 1 deletions
3
array.c
3
array.c
|
@ -5717,7 +5717,8 @@ rb_ary_dig(int argc, VALUE *argv, VALUE self)
|
|||
* ["a", "b", "c"].sum("") #=> "abc"
|
||||
* [[1], [[2]], [3]].sum([]) #=> [1, [2], 3]
|
||||
*
|
||||
* However, Array#join and Array#flatten is faster than Array#sum.
|
||||
* However, Array#join and Array#flatten is faster than Array#sum for
|
||||
* array of strings and array of arrays.
|
||||
*
|
||||
* ["a", "b", "c"].join #=> "abc"
|
||||
* [[1], [[2]], [3]].flatten(1) #=> [1, [2], 3]
|
||||
|
|
Loading…
Reference in a new issue