I have array IDs
[671322109, 671322111, 0, 671322113]
How to findout if IDs includes 0 and how to delete it
if (IDs.includes(0)) {
IDs.filter(Number);
and
IDs.splice(0);
}
Not Working
I have array IDs
[671322109, 671322111, 0, 671322113]
How to findout if IDs includes 0 and how to delete it
if (IDs.includes(0)) {
IDs.filter(Number);
and
IDs.splice(0);
}
Not Working
Hey you can do it this way.
let ids = [671322109, 671322111, 0, 671322113];
ids = ids.filter(id => id != 0);