I am working on a scraping script and found about Set object which should store unique datas and fast in performance. So I tried it like this
let scrapedMessages = new Set()
scrapedMessages.add({
text,
...(images.length > 0 && {
images,
}),
senderID,
timestamp,
})
But when looking at the data scraped I found out these type of duplicate datas
{
"text": "Acne Fighting Facial Wash With Jojoba Beads",
"senderID": "361571627329333",
"timestamp": "1613017270619"
},
{
"text": "Acne Fighting Facial Wash With Jojoba Beads",
"senderID": "361571627329333",
"timestamp": "1613017270619"
}
Does it mean Set of Objects might not be unique or I am doing some mistakes. I was doing it through simple array. But shifted to Set type for better performance. Can it be achieved? What is the best practice?
I am running the puppeteer script on Nodejs.