Remove object from array of objects in javascript

Remove Object from an Array by its Value #

To remove an object from an array by its value:

Call the findIndex() method to get the index of the object in the array.Use the splice() method lớn remove the element at that index.The splice method changes the contents of the array by removing orreplacing existing elements.
const arr = ;const indexOfObject = arr.findIndex(object => return object.id === 3;);console.log(indexOfObject); //