jsFiddle Demo
Option0 is in there because it is part of the array. The 0 index of your array is "what is your name?", in the first piece, and "what is your brother's name?" in the second.
Using for in is going to iterate each index, and taking the 0 index ends up taking that string as one of the possible answers you have. As you are assuming that [0] of the answer is the name, and [1] as the flag, the result of [0] and [1] on "what is your name?" is w and h. The index of the array is 0 at that point, so you end up with "option0" : {"ans" : w, "cor:"h"}, which you don't want.
The fix is simple, just skip that index in your for in loop using a conditional if and a continue
if(n == 0)continue;
I slightly refactored your code to make it a little easier to read as well
var objects = [
[
"what is your name?",
["Alex", false],
["Hervy", false],
["Rico", true],
["Tom", false]
],
[
"what is your brother's name?",
["Alex", false],
["Hervy", true],
["Rico", false],
["Tom", false]
]
];
var el = document.getElementById("out");
el.innerHTML += 'var qus ={ <br>';
for (i in objects){
var qset = objects[i];
el.innerHTML += '{ <br>';
el.innerHTML += '"qus" :"' + qset[0] + '",<br>';
for (n in qset){
if(n == 0)continue;
var nameset = qset[n];
el.innerHTML += '"option' + n;
el.innerHTML += '" : {"ans" : ' + nameset[0];
el.innerHTML += ', "cor:"' + nameset[1] + '"},<br>';
}
el.innerHTML += '},<br><br>';
}
el.innerHTML += '}';
JSON.stringify(obj). Much less error prone.