How To Remove Duplicate Value from Array in Reactjs ?




Now let's see example of how to remove duplicate value from array in reactjs. We will talk about reactjs remove duplicate value from array. you can simply delete duplicate value from array in Reactjs.

In this example i have simple array with duplicate values array and i will perform to get only unique values from array It is possible by filter. Its help to remove duplicate values from array in reactjs.


import React from 'react'

export default class Home extends React.Component{


const depArray = [100,80, 70, 80, 90,100, 71, 80];

var newArray = [];

var newArray = depArray.filter(function(elem, pos) {

return depArray.indexOf(elem) == pos;







It will help you...