collect.js
Advanced tools
Comparing version 4.0.11 to 4.0.12
{ | ||
"name": "collect.js", | ||
"version": "4.0.11", | ||
"version": "4.0.12", | ||
"description": "Convenient and dependency free wrapper for working with arrays and objects.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -12,2 +12,3 @@ # <img src="https://raw.githubusercontent.com/ecrmnn/collect.js/master/collectjs.jpg" alt="collect.js"> | ||
[![eslint](https://img.shields.io/badge/code_style-airbnb-blue.svg?style=flat-square)](https://github.com/airbnb/javascript) | ||
[![cdnjs version](https://img.shields.io/cdnjs/v/collect.js.svg?style=flat-square)](https://cdnjs.com/libraries/collect.js) | ||
@@ -621,3 +622,3 @@ ### Installation | ||
#### ``get()`` | ||
The get method returns the item at a given key. If the key does not exist, ``null`` is returned: | ||
The get method returns the item at a given key or index. If the key or index does not exist, ``null`` is returned: | ||
```js | ||
@@ -634,5 +635,14 @@ const collection = collect({ | ||
collection.get('middlename'); | ||
//=> null | ||
``` | ||
```js | ||
const collection = collect(['a', 'b', 'c']); | ||
collection.get(1); | ||
//=> b | ||
``` | ||
You may optionally pass a default value as the second argument: | ||
@@ -639,0 +649,0 @@ ```js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
368441
2087
203