0

I have list of objects created like this:

for(var i = 0; i < retrievedContactsArr.length; i++){
    for(var k = 0; k < result.length; k++){
        if(retrievedContactsArr[i].contact.phone.cell && retrievedContactsArr[i].contact.phone.cell === result[k].contact.phone.cell){
            retrievedContactsArr.splice(i, 1);
        }
    }
    retrievedContactsObj[i] = retrievedContactsArr[i];
}

But they are created with keys "0", "1" like this:

{
    "0": {
        "contact": {
            "address": {
                "home": "",
                "office": ""
            },
        },
        "name": "Test3"
    },
    "1": {
        "contact": {
            "address": {
                "home": "",
                "office": ""
            },
        },
        "name": "Test2"
    }
}

How do I remove the keys for the above object ?

2
  • 2
    Use an array maybe? Not sure what you are looking to accomplish here. Commented Dec 20, 2016 at 21:12
  • Because object are the same, how can you distinguish that from each other? You shuold use an array to do that Commented Dec 20, 2016 at 21:14

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.