In Ruby, how do I skip a loop in a .each loop, similar to 'continue'
Using return from within a block intentionally can be confusing. For instance: def my_fun [1, 2, 3].map do |e| return "Hello." if e == 2 e end end my_fun will result in "Hello.", not [1, "Hello.", 2], because the return keyword pertains to the outer def, not the inner block.