On Mar 9, 1:34 pm, Francesco Sullo <[EMAIL PROTECTED]> wrote:
> d is an Object
> d.Products is an Array
>
> You could test you objects using the "constructor" property. If you try:
>
> alert (d.constructor)
>
> you could see that it shows a result different from
>
> alert(d.Products.constructor)
d is an Object
d.Products is an Array
You could test you objects using the "constructor" property. If you try:
alert (d.constructor)
you could see that it shows a result different from
alert(d.Products.constructor)
--Francesco
[EMAIL PROTECTED] ha scritto:
I'm confused. Why does:
var
I'm confused. Why does:
var d = {
"Products": [
"Books", "Electronics"
]
};
alert(typeof d["Products"]);
Report "object" and not "array"? How am I supposed to tell if I have
an array rather than a "map" object?
Thanks,
T.
___