How can i specify which index to start from when using each_with_index
on a collection in ruby 1.8.7?
collection.each_with_index do |element, index = 1|
#do smth
end
Using it like this gives the following error:
syntax error, unexpected '=', expecting '|'
collection.each_with_index do |element, i = 1|
try this:
this example will start from fifth element.