1.0.9 • Published 2 years ago

@hinng/remove_duplicates_array v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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}]
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago