The API I'm contacting returns an object to me. One of its keys / properties is called "length", and this causes strange behavior:
var obj = {"text1":{"index":0,"lengt":5}}; //modified key for testing $.each(obj.text1,function(k,v){ console.log ('i: '+k+' v: '+v); }); i: index v: 0 //this is the result I'm looking for i: lengt v: 5 var obj = {"text1":{"index":0,"length":5}}; //original object i: 0 v: undefined // ???? i: 1 v: undefined i: 2 v: undefined i: 3 v: undefined i: 4 v: undefined
I assume that length is a reserved word, but this is how the original object happens. What would be the best way to identify and solve this problem?
Thanks so much for any help.
source share