Skip to content
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

[5.5] Document Collection::unwrap() method #3689

Merged
merged 1 commit into from
Oct 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ For the remainder of this documentation, we'll discuss each method available on
[union](#method-union)
[unique](#method-unique)
[uniqueStrict](#method-uniquestrict)
[unwrap](#method-unwrap)
[values](#method-values)
[when](#method-when)
[where](#method-where)
Expand Down Expand Up @@ -1529,6 +1530,23 @@ The `unique` method uses "loose" comparisons when checking item values, meaning

This method has the same signature as the [`unique`](#method-unique) method; however, all values are compared using "strict" comparisons.

<a name="method-unwrap"></a>
#### `unwrap()` {#collection-method}

The static `unwrap` method returns the collection's underlying items from the given value when applicable:

Collection::unwrap(collect('John Doe'));

// ['John Doe']

Collection::unwrap(['John Doe']);

// ['John Doe']

Collection::unwrap('John Doe');

// 'John Doe'

<a name="method-values"></a>
#### `values()` {#collection-method}

Expand Down