Basically, in able to remove the specific element from an array, first you need to find the index of an element with the help of indexOf and can able to remove it using splice function. Below is the code for your reference:
const intel = [1, 5, 10];
console.log(intel);
const index = intel.indexOf(5);
if (index > -1) {
intel.splice(index, 1);
}
// intel = [1, 10]
console.log(intel);
I hope this will help.
Want to know more about Java? Prefer this tutorial on Learn Java.
Want to become a Java expert? Join Java Certification now!!