diff --git a/collections.md b/collections.md index a9f7cca0fb9..5a30c61de64 100644 --- a/collections.md +++ b/collections.md @@ -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) @@ -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. + +#### `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' + #### `values()` {#collection-method}