Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

BurdetteLamar
Copy link
Member

No description provided.

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Oct 9, 2024
array.c Outdated
Comment on lines 2679 to 2684
* a = []
* ['a', 'b', 'c'].reverse_each do |element|
* a.push(element)
* a.clear if element.start_with?('b')
* end
* a # => ["a"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't demonstrate the array that is being iterated on is modified. It demonstrates that a (which is an unrelated array) is modified.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revised.

@peterzhu2118 peterzhu2118 merged commit 0910050 into ruby:master Oct 10, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants