Checking length of dictionary object [duplicate]

I’m trying to check the length here. Tried count. Is there something I’m missing?

var dNames = {}; 
dNames = GetAllNames();

for (var i = 0, l = dName.length; i < l; i++) 
{
        alert("Name: " + dName[i].name);
}

dNames holds name/value pairs. I know that dNames has values in that object but it’s still completely skipping over that and when I alert out even dName.length obviously that’s not how to do this…so not sure. Looked it up on the web. Could not find anything on this.

4 Answers
4

Leave a Comment