On Thu, 10 Jun 2004 04:59:14 GMT, Jeff Thies wrote:
var hash=new Array();
hash['a']='some_value';
hash['b']='some other value';
Whar do you call that in javascript?
Array. With two new custom properties, called "a" and "b":
alert(hash.a);
alert(hash.b);
I know it's possible to define this in one line, but I've forgotten how.
Something like:
var hash=new Array('a':'some value','b':'some other value') ???
You mean:
var hash={a:"some value",b:"some other value");
This is not an Array. This is an Object. And this syntax is called "Object
Initializer".
The previous code is equals to:
var hash=new Object();
hash.a="some value";
hash.b="some other value";
--
ZER0://coder.gfxer.web-designer/
~ "When you have eliminated the impossible, whatever remains,
however improbable, must be the truth." (S.H.)