179
rated 0 times
[
183]
[
4]
/ answers: 1 / hits: 23002
/ 12 Years ago, sat, november 24, 2012, 12:00:00
Possible Duplicate:
Array length undefined
I have the following array but whenever I try to find out the length with categoryData.length
it gives me only undefined
. If I type console.log(categoryData)
it gives me all the objects in the array.
var categoryData = {
animals: {
name: Animals,
description: All your favorites from aardvarks to zebras.,
items: [
{
name: Pets
},
{
name: Farm Animals
},
{
name: Wild Animals
}
]
},
colors: {
name: Colors,
description: Fresh colors from the magic rainbow.,
items: [
{
name: Blue
},
{
name: Green
},
{
name: Orange
},
{
name: Purple
},
{
name: Red
},
{
name: Yellow
},
{
name: Violet
}
]
},
vehicles: {
name: Vehicles,
description: Everything from cars to planes.,
items: [
{
name: Cars
},
{
name: Planes
},
{
name: Construction
}
]
}
};
More From » multidimensional-array