Using new Set() in Function node

Describe the issue/error/question

I was trying to use Javascript’s Set in a Function node, but I get an empty object when logging the set to console. Is this not possible or am I missing sth?

Please share the workflow

Information on your n8n setup

  • n8n version: 0.193.5
  • Database you’re using (default: SQLite): Postgres
  • Running n8n with the execution process [own(default), main]: main
  • Running n8n via [Docker, npm,, desktop app]: Docker

Funny cause I was able to use the following no problem:

let years = [2012, 2012, 2015]
const uniqueYears = [ Set(years)];
console.log(uniqueYears); // --> [2012, 2015]