What is the correct way to define an array in Ruby?
A. array = ["element1", "element2"]
B. array = Array.new
C. array = new Array
D. array = list("element1", "element2")
Answer: Option A
Related Questions on Basic Syntax in Ruby
What does the 'puts' method do in Ruby?
A. Prints to console
B. Converts to string
C. Finds the length
D. Reads input from user
Join The Discussion