+ 6

What is difference between array.length and array.size ??

difference between size and length of a array

24th Jun 2017, 11:55 AM
Avinash Gupta
Avinash Gupta - avatar
3 Answers
+ 5
There is no difference. Length is aliased as size, size is an alias of length.
24th Jun 2017, 12:05 PM
Jakub MiziƄski
Jakub MiziƄski - avatar
+ 2
https://ruby-doc.org/core-2.2.0/Array.html#method-i-length According to documentation, size and length are just aliased to each other, and thus behave identically.
24th Jun 2017, 12:10 PM
jojo
0
Thanks Jakub and Jojo..
24th Jun 2017, 12:20 PM
Avinash Gupta
Avinash Gupta - avatar