Assume I have an array in my script and it's made up like this:
var detail= {};
detail['i100']=new Array()
detail['i100']['ID 4564']= 'John'
detail['i100']['ID 4899']= 'Paul'
detail['i100']['ID 9877']= 'Andy'
detail['i100']['ID 1233']= 'Evan'
detail['i25'] = new Array()
detail['i25']['ID 89866']= 'Paul s'
detail['i25']['ID 87866']= 'Paul'
I then use this script to get the values of the first part of the array:
$.each(detail, function(vehicle) {
console.log( vehicle )
});
This gives me two results as expected (i100
and i25
), What I want to do however is, by using the reference vehicle, get all the names and values of the second dimension –
i.e. by using i25
I want to return ID 89866
and ID 87866
. I have tried children()
, but it is just not working. Does anyone have any advice, please ?