πŸ“Š Ruby
Q. How do you add an element to the end of an array in Ruby?
  • (A) array.add(element)
  • (B) array.append(element)
  • (C) array.push(element)
  • (D) array.insert(element)
πŸ’¬ Discuss
βœ… Correct Answer: (C) array.push(element)

Explanation: 'push' method adds an element to the end of an array.

Explanation by: Rati Dubey
'push' method adds an element to the end of an array.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
66
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Rati Dubey
Publisher
πŸ“ˆ
89%
Success Rate