0

first i wanna sorry for my english. ya, its very bad. so. lets go: i've this obj:

estrutura = {  
 //tags 
 div : { 

      //subtags
      id:'page',
      classe:'container_12 ',

      conteudo: {
          esqueda: {
             //childSubTags
            id:'divMenuVertical',
            classe:'grid_3',
            conteudo : 'Ola, sou um grid de 3 colunas'
          },
            centro: {
            id:'divConteudo',
            classe:'grid_5',
            conteudo: 'ola, sou um grid de 5 colunas'
         },
          direita: {
            id:'divConteudo',
            classe:'grid_3',
            conteudo: 'Ola, sou um grid de 3 colunas'
          }
      }
  }

}

but when i try do something like:

Array.isArray(estrutura[0]) 

returns the index isn't a array. why? i'm trying make a recursive searching. someone could helpe me please?

1
  • Well estrutura[0] is undefined. Commented Dec 25, 2013 at 16:26

1 Answer 1

2

it is not array because it is object. Everything in javascript are objects. You should create array like this: var myArray = new Array();

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.