loading
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const listWithDups = [{ name: 'one' }, { name: 'two' }, { name: 'one' }, { name: 'three' }]

console.log('With dups:\n', listWithDups)

const uniqueList = [], temp = {}

for (let item of listWithDups) {
  // If we haven't seen this name before
  if (!temp[item.name]) {
    uniqueList.push(item)  // Add to unique list
    temp[item.name] = true // Remember the name
  }
}

console.log('Unique list:\n', uniqueList)
Fetching token