Jump to content

Why is array element undefined when I have defined it?


longtone

Recommended Posts

	
aaa = 'boo a';

bbb = new Array();

bbb['av'] == 'boo b';

alert(aaa);

alert(bbb['av']);

 

displays: alert('boo a')

then alert('undefined')

I know this is something really basic, but why is it undefined when I've declared the array and given the element a value?

 

see it in action:

http://www.phpplaypen.co.uk/jso.php

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.