@hinng/remove_duplicates_array

1.0.9 • Public • Published

remove_duplicates_array


Report bug | New feature | Change Log

NPM

Language grade: JavaScript Total alerts Build Status CircleCI

This is the array that handle duplicate item, either objects are inside the array, or number inside the array.

To test this code you can see the test case in test/array.test.js, and use the npm test for trigger the jest

toArray() will make the inputs returning as a array

toString() will return the array as string, like 'A,B,C,D'

const removeArrayDuplicate = require("@hinng/remove_duplicates_array");

const array = [1234, 234, 123, 1234];
let test = new removeArrayDuplicate(array);
console.log(test.removeDuplicate()); // return [1234, 234, 123]
const removeArrayDuplicate = require("@hinng/remove_duplicates_array");

const array = ["AA", "AB", "AC", "AD", "AA"];
let test = new removeArrayDuplicate(array);
console.log(test.removeDuplicate()); // return ['AA', 'AB', 'AC', 'AD']
const removeArrayDuplicate = require("@hinng/remove_duplicates_array");

const array = [{ a: 1 }, { b: 2 }, { c: 3 }, { a: 1 }];
let test = new removeArrayDuplicate(array);
console.log(test.removeDuplicate()); // return [{a: 1}, {b: 2}, {c: 3}]

Readme

Keywords

Package Sidebar

Install

npm i @hinng/remove_duplicates_array

Weekly Downloads

3

Version

1.0.9

License

ISC

Unpacked Size

8.35 kB

Total Files

8

Last publish

Collaborators

  • hinng