Explain redo vs. retry usage

Technology CommunityCategory: RubyExplain redo vs. retry usage
VietMX Staff asked 3 years ago

redo and retry are both used to re-execute parts of a loop. But they differ in how much they re-execute:

  • redo only repeats the current iteration, while
  • retry repeats the whole loop from the start.