this is an array that contains the question on index 0 and choices from 1-4 and then on index 5 contains the answer. I want to access these index numbers individually but cant.
questionbank = [
["Which city is the capital of Pakistan", "Islamabad", "Karachi", "Lahore", "Quetta", "Islamabad"],
["Which city is the capital of U.A.E", "Dubai", "Abu Dhabi", "Sharjah", "Ras Al-Khaimah", "Dubai"],
["Which city is the capital of United States of America", "Austin", "Washington DC", "Boston", "Colorado", "Washington DC"],
["Which city is the capital of UK", "London", "Manchester", "Leeds", "Sunderland", "London"],
["Which city is the capital of Kuwait", "Kuwait City", "Salmiya", "Jahra", "Tokyo", "Kuwait City"],
["Which city is the capital of Saudi Arabia", "Riyadh", "Mecca", "Madinah", "Jeddah", "Riyadh"],
["Which city is the capital of India", "Mumbai", "Delhi", "Bareilly", "Calcutta", "Mumbai"],
["Which city is the capital of Afghanistan", "Kabul", "Kandahar", "Herat", "Jalalabad", "Kabul"],
["Which city is the capital of Ireland", "Dublin", "Belfast", "Cork", "Limerick", "Dublin"]
];
function next_question() {
text = questionbank[0, 0];
alert(text);
}
next_question();
The problem is when i call [0,0] the whole sentence in the array comes up instead of just one element in the array. My array is a collection of questions on position 0 and the collection of choices in the other positions. Can you please tell me how to access only one element of the array at a time!