How should I add Multiple choice answer to an object please?
Hello Everyone,
I have declared an array which holds an object such as:
var myArr:Array = new Array({Question: 'Primary Colors Are?'});
How can I add the multiple choices to the object, please? These are the choices:
red, green, blue
orange, red, white,
purple, yellow, green,
white, black, blue
I certainly can create the Answers as:
var myArr:Array = new Array({ Question: 'Primary Colors Are?', Answer1: 'red, green, blue',
, Answer2: 'orange, red, white, Answer3: 'purple, yellow, green', Answer4: 'white, black, blue' });
What I would like to do is to be able to store all the answer choices within an array called AnsArr. Can I declare a new array within the same obejct such as AnsArr and push these choices to it? I would highly appreciate your help.
Thanks.