Actions
Misc #14673
closedDocumentation for `Array#drop` / `drop_while` unclear in regard to modification
Misc #14673:
Documentation for `Array#drop` / `drop_while` unclear in regard to modification
Status:
Closed
Assignee:
-
Description
The documentation for Array#drop says:
Drops first
nelements fromaryand returns the rest of the elements in an array.
It's unclear if the receiver is being changed or not (it is not). The documentation should be more explicit in that regard.
Maybe something like "Returns a new array containing all except the first n elements from ary".
This also applies to Array#drop_while.
Updated by Earlopain (Earlopain _) 9 days ago
- Status changed from Open to Closed
Docs today say this:
Returns a new array containing all but the first count element of self, where count is a non-negative integer; does not modify self.
Actions