Vidyalelo
Ruby Programming · Q17

Arrays, Hashes and Strings in Ruby

Programming · Ruby Programming · question 17

Q17

What does the '<<' operator do when used with arrays in Ruby?

A.
Adds an element to the beginning of the array
B.
Adds an element to the end of the array
Answer
C.
Removes the last element from the array
D.
Concatenates two arrays

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board