Reputation: 19882
I need to extract Asia from this array. How can i do that. Here is a sample array? This is javascript. i need to extract Asia from first index. Help required.
var myData = new Array(['Asia', 437, 520],['Middle East', 20, 31],['Aus/Oceania', 19,21]);
Upvotes: 0
Views: 1267
Reputation: 8871
myData[0][0]
will work or else you can try like this
var myData = new Array(['Asia', 437, 520],['Middle East', 20, 31],['Aus/Oceania', 19,21]);
var arr=myData[0];
var spl=arr.shift();
alert(spl);
Upvotes: 0
Reputation: 1127
You could access it via myData[0][0]
if that's what you mean.
Upvotes: 0