Question: I have an object which has duplicate values so i used delete new\_object[1] to delete the value but when I see this in console its showing undefined in object 0800

```
["293", undefined, "298", "297"]

```

Answer: 
You should use

```
arr.splice(index, 1);

```

`delete` only removes the element, but keeps the indexes. [This question](https://stackoverflow.com/questions/5767325/remove-a-particular-element-from-an-array-in-javascript) is similar in nature and provides more information.
you need to use **splice()** in order to remove the value from the array. What you are doing is simply setting it to undefined.

```
var myArray = ['295', '296', '297', '298'];

// removes 1 element from index 2
var removed = myArray.splice(2, 1);
// myArray is ['295', '296', '298'];
// removed is ['297']

```

**Reference** from [Array.splice](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/splice)

> 
> The splice() method changes the content of an array by removing
>  existing elements and/or adding new elements.
> 
> 
>