Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

collect.js

Package Overview
Dependencies
Maintainers
1
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect.js - npm Package Compare versions

Comparing version 4.0.11 to 4.0.12

2

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc