[advanced programming] js array deduplicates any type

write a function to remove duplicates of any type in the js array:
input: [a "," a ", 0,0, {}, {code 1}, {aV1}, [], [], [1], [1], null, null, undefined,undefined, /\ .js $/, /\ .js $/, /\ .js $/]
output: [" a ", 0, {}, {avell}, [], [1], null, undefined /\ .js $/]


const unique = (array) => {
    let obj = {}
    return array.filter((item, index) => {
      // key
      let newItem = item + JSON.stringify(item)
      return obj.hasOwnProperty(newItem) ? false : obj[newItem] = true
    })
}

clipboard.png


this is not deduplication of any type, this is array deduplication

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-7b7bcd-166d4.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-7b7bcd-166d4.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?