Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Enumerator::Lazy#each_with_index

() { (E, ::Integer index) -> untyped } -> self
() -> ::Enumerator[[ E, ::Integer ], self]
lazy.each_with_index {|(*args), idx| block }
lazy.each_with_index

Equals to with_index(0).

See Enumerator#with_index.