As per my understanding of the problem. You need to use questions[0][cax]
instead of questions[0].cax
var questions = [{
"qu": "question?",
"ca0": "answer1",
"ca1": "answer2"
}];
for (var i = 0; i < 10; i++) {
var cax = "ca" + i;
if (questions[0][cax] == null) {
alert("there are " + (i + 1) + "answers");
break;
}
}