-5

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

1 Answers1

1

Hey you can do it this way.

let ids = [671322109, 671322111, 0, 671322113];
ids = ids.filter(id => id != 0);
Yash Goyal
  • 164
  • 8