how can I write the objects in my array to the console without repeating them. Have one of each element in the array. For example this --
const arr = [
{
id: 1,
name: 'Jake'
},
{
id: 1,
name: 'Jake'
},
{
id: 2,
name: 'Sara'
},
{
id: 2,
name: 'Sara'
}
]
const newArray = [
{
id: 1,
name: 'Jake'
},
{
id: 2,
name: 'Sara'
}
]
const otherArray = [12, 23, 25, 12, 25, 46]
const newOtherArray = [12, 23, 25, 45]