Js gets duplicates in the array

the array is as follows

[
{checked: true, index: 0}
{checked: true, index: 1}
{checked: true, index: 2}
{checked: true, index: 3}
{checked: true, index: 4}
{checked: true, index: 5}
{checked: true, index: 1}
]

output

[checked:true, index: 1]
Mar.04,2022

const arr = [
  {checked: true, index: 0},
  {checked: true, index: 1},
  {checked: true, index: 2},
  {checked: true, index: 3},
  {checked: true, index: 4},
  {checked: true, index: 5},
  {checked: true, index: 1}
]

const mapper = {}
const newArr = []

for (let item of arr) {
  const {index, checked} = item
  if (mapper[index]) {
    newArr.push(item)
  } else {
    mapper[index] = true
  }
}

console.log(newArr)

const a = [
    {checked: true, index: 0},
    {checked: true, index: 1},
    {checked: true, index: 2},
    {checked: true, index: 3},
    {checked: true, index: 4},
    {checked: true, index: 5},
    {checked: true, index: 1}
]

const result = Array.from(a.reduce((m, t) => m.set(t.place, t), new Map()).values());
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b40a7c-2c529.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b40a7c-2c529.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?