Ruby - What does this code do, step by step? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Ruby - What does this code do, step by step?

col = %w(colours gray green blue) num = %w(numbers four five nine) a = [col,num] puts a.assoc("numbers")[1]

2nd Feb 2020, 11:44 PM
Paolo De Nictolis
Paolo De Nictolis - avatar
1 Answer
+ 6
You will understand, after reading the function of assoc. https://www.geeksforgeeks.org/ruby-assoc-function/
3rd Feb 2020, 12:05 AM
Fernando Pozzetti
Fernando Pozzetti - avatar