You can use the splice() method.
Code:
let arr = [1, 2, 3, 4, 5];
// Remove the element at index 2
arr.splice(2, 1);
console.log(arr); // Output: [1, 2, 4, 5]
Explanation:
splice(index, count) modifies the array in place.
index: The position where deletion begins.
count: Number of elements to delete.