Exists a more elegant way to create an object from an array than this one?
var createObject = function(){
var myArray= generateArray();
var myObject = {
question : myArray[0],
answerA : myArray[1],
answerB : myArray[2],
answerC : myArray[3],
answerD : myArray[4]
};
return myObject;
}
questionand all remaining elements become answers A, B, C, etc., then you could use a loop - but if there are only ever four answers the loop code isn't going to be much shorter, so...