0

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]);    
1
  • 5
    Read a JavaScript tutorial, especially about arrays. Make sure you understand at least the basics of a language before you do anything else. Commented Mar 22, 2012 at 11:40

5 Answers 5

1

You could access it via myData[0][0]

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

0

You could access it via myData[0][0] if that's what you mean.

Comments

0

Have you tried myData[0][0] and doesn't work?

Comments

0

myData[0][0] will give you Asia.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.