New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

remove-deep-duplicate-from-array

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remove-deep-duplicate-from-array

remove duplicate values from an array

latest
Source
npmnpm
Version
1.0.9
Version published
Maintainers
1
Created
Source

removeDeepDuplicatesValues

You can pass array in argument if any two values are same wether different indexing it will appear single time

Example 1

const deepDuplicate = require("remove-deep-duplicate-from-array")

    let x = ['a' ,'b' , 'c' ,'a' , 'd' , 'b']

    let y = deepDuplicate(x)

    //output
    //y =  [ 'a', 'b', 'c', 'd' ]  

If we wants to remove the repeated values but values have complex structered objects and arrays it can remove repeated ones like ...

Example 2

const deepDuplicate = require("remove-deep-duplicate-from-array")

let x = ['a' ,'b' ,'c' ,'b' ,{d:'d' , e:'e' ,f:'f'} , {f:'f' , e:'e' ,d:'d'} , ['g' , 'h' ,'i'] , ['i' , 'h' ,'g']]

let y = deepDuplicate(x)

// output
// [ [ 'g', 'h', 'i' ], 'a', 'b', 'c', { d: 'd', e: 'e', f: 'f' } ] 

Keywords

javascript

FAQs

Package last updated on 04 Mar 2020

Did you know?

Socket

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