KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm probably missing something obvious, but is there a way to access the index/count of the iteration inside a hash each loop? hash = {'three' => 'one', 'four' => 'two', 'one' => 'three'} hash.each { |key, value| # any way to know which iteration this is # (without having to create a count variable)? }
Tags (comma-separated)
Save Edits
Cancel