I have the following array of objects. I wanted to make new array of object excluding date
field.
The new array should return as follows:
const new_arr = [
{
"id": 1,
"user": 0
},
{
"id": 2,
"user": 0
}
]
What's my mistake here?
const arr = [{
"id": 1,
"date": 0,
"user": 0
},
{
"id": 2,
"date": 0,
"user": 0
}
]
const new_arr = arr.filter((items) => !items.date)
console.log(new_arr);