var test = var[0] && var[0].friends && var[0].friends[3] && var[0].friends[3].image ? var[0].friends[3].image : 'def'