Duplicate array remover module is easy to use, it remove all duplicate values from the array and return with new array.
Install duplicate-remover-array-v1 with npm
npm install duplicate-remover-array-v1
To import module in your js file
const duplicate = require("duplicate-remover-array-v1");
const a = [1, 2, 3, 1, 4, 1, 2, 5, 3, 4];
console.log(duplicate(a));