I have seen this link about associated array in Ruby, and I know, it is completely like php.
But take a look at this piece of code:
x=[1,"Jef",:three]
it is clear that x[1]="jef"
, but the question is:
What is the role of :three
.
I gussed it should be a key with a nill value, and i changed the code to this
x=[1,"Jef",:three,4]
and when i run it, I faced with this error:
no implicit conversion of Symbol into Integer (TypeError)
so what are the roles of : and three here?