Modify and manipulate JavaScript array

You can use reduce() and Set combination for example. Read from the docs:

The Set object lets you store unique values of any type, whether primitive values or object references.

The reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single output value.

Please see a possible working solution.

const array = ['business>management', 'News>Entertainment News', 'business>Entrepreneurship'];

const result = array.reduce((a,c) => {
  c.split('>').forEach(e => a.add(e));
  return a;
}, new Set());

const unique = Array.from(result);


I hope that helps!

try this one -

const array = ['business>management', 'News>Entertainment News', 'business>Entrepreneurship'];
let newArray = []>{
    let newData = item.split(">").map((itemIn)=>{ 
      return item
    return newData


let array = ['business>management', 'News>Entertainment News', 'business>Entrepreneurship'];

let separated =, ii) => {
    return item.split(">")
}).reduce((a, b) => a.concat(b)).filter((value, index, self) => {
    return self.indexOf(value) === index;