Skip to content

sentot205/array-unique-reactjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Array Unique Reactjs

Npm package that works to convert data to unique arrays. In other words the package to remove the existing data duplication in the data array.

Example

import getUnique from "array-unique-reactjs";

const prizelips = [
  {
    title: "40M",
    price: 5000,
  },
  {
    title: "100M",
    price: 30000,
  },
  {
    title: "350M",
    price: 100000,
  },
  {
    title: "1B",
    price: 100000,
  },
  {
    title: "2.5B",
    price: 200000,
  },
];

const uniquePrize = getUnique(prizelips, "price");

function Test() {
  return (
    uniquePrize.map((item) => console.log(item.price))
    // Output : 5000, 30000, 100000, 200000
  );
}