Instead of this:
if(acquaintances.types){
if(aquaintances.types.friends){
if(acquaintances.types.friends.others){
// do stuff with the "others" array here
}
}
}
Try this:
if(acquaintances &&
acquaintances.types &&
acquaintances.types.friends &&
acquaintances.types.friends.others) {
}
Or
acquaintances &&
acquaintances.types &&
acquaintances.types.friends &&
acquaintances.types.friends.others ?
doSomething() : doSomethingElse()