Socket
Socket
Sign inDemoInstall

array-duplicated

Package Overview
Dependencies
1
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    array-duplicated

Return an Array of duplicated values in a given Array


Version published
Weekly downloads
32
increased by60%
Maintainers
1
Install size
10.6 kB
Created
Weekly downloads
 

Readme

Source

array-duplicated

npm version Build Status Coverage Status

Return duplicated values in a given Array

arrayDuplicated(['a', 2, 'b', true, 'b', 12, 'b', true, ['a']]) //=> ['b', true];

Installation

Use npm.

npm install array-duplicated

API

import arrayDuplicated from 'array-duplicated';

arrayDuplicated(array)

array: Array<any>
Return: Array

It finds duplicated values in the Array and returns an Array of them.

arrayDuplicated([0, 1, 1, 1, 1, 1, 1, 1, 1, 1]); //=> [1]

"Duplicated" means a value is identical to another value in the ECMAScript same-value equality level.

arrayDuplicated([-1, 1]); //=> []

License

ISC License © 2017 - 2018 Shinnosuke Watanabe

Keywords

FAQs

Last updated on 22 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc