简体   繁体   中英

Extract values from Javascript Array

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]);    

您可以通过myData [0] [0]访问它

您可以通过myData[0][0]访问它。

您是否尝试过myData[0][0]但不起作用?

myData[0][0]将带给您Asia

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); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM