Skip to content

Commit 856e25c

Browse files
committed
Document Collection::unwrap() method
1 parent 88609fd commit 856e25c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

collections.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ For the remainder of this documentation, we'll discuss each method available on
121121
[union](#method-union)
122122
[unique](#method-unique)
123123
[uniqueStrict](#method-uniquestrict)
124+
[unwrap](#method-unwrap)
124125
[values](#method-values)
125126
[when](#method-when)
126127
[where](#method-where)
@@ -1529,6 +1530,23 @@ The `unique` method uses "loose" comparisons when checking item values, meaning
15291530

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

1533+
<a name="method-unwrap"></a>
1534+
#### `unwrap()` {#collection-method}
1535+
1536+
The static `unwrap` method returns the collection's underlying items from the given value when applicable:
1537+
1538+
Collection::unwrap(collect('John Doe'));
1539+
1540+
// ['John Doe']
1541+
1542+
Collection::unwrap(['John Doe']);
1543+
1544+
// ['John Doe']
1545+
1546+
Collection::unwrap('John Doe');
1547+
1548+
// 'John Doe'
1549+
15321550
<a name="method-values"></a>
15331551
#### `values()` {#collection-method}
15341552

0 commit comments

Comments
 (0)