Tell the end of a .each loop in ruby January 4, 2023 by Tarik users.each_with_index do |u, index| # some code if index == users.size - 1 # code for the last user end end