0
Ruby Array Question
ruby arrays, I'm trying to understand how x=[1 2 3] y=[3 4 5] res=x|y puts res[2] ... How did they come up with 2?
3 Antworten
+ 7
please state your question more clearly .what is the problem.Are you not getting the output or are you getting the wrong output ? @Sharon
+ 7
moreover in ruby, the elements inside array are separated with commas
U should declare array like this :-
x=[1,2,3]
y=[3,4,5]
Any more doubts, feel free to ask @Sharon Lewis
0
I understand that the array starts with zero, but the third element doesn't give me 2.