Project

General

Profile

Misc #14673

Documentation for `Array#drop` / `drop_while` unclear in regard to modification

Added by sos4nt (Stefan Schüßler) 10 days ago.

Status:
Open
Priority:
Normal
Assignee:
-
[ruby-core:86489]

Description

The documentation for Array#drop says:

Drops first n elements from ary and 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.

Also available in: Atom PDF