8000 [DOC] Tweaks for Array#reverse_each by BurdetteLamar · Pull Request #11855 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

[DOC] Tweaks for Array#reverse_each #11855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 10, 2024
Merged

[DOC] Tweaks for Array#reverse_each #11855

merged 4 commits into from
Oct 10, 2024

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
0