You are viewing a single comment's thread. Return to all comments →
First test answer: ["3:panda", "4:tiger", "5:deer"]
def skip_animals(animals, skip) animals[skip..-1].each_with_index.map {|v,i| "#{i+skip}:#{v}" } end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Enumerable - each_with_index
You are viewing a single comment's thread. Return to all comments →