In Ruby, what's the difference between {}
and []
?
{}
seems to be used for both code blocks and hashes.
Are []
only for arrays?
The documention isn't very clear.
In Ruby, what's the difference between {}
and []
?
{}
seems to be used for both code blocks and hashes.
Are []
only for arrays?
The documention isn't very clear.