Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

144
Visualizações
How to read values from nested arrays

How to get to level4 node and read its value

Code sample on TS playground

const sectors = {
  "level1": [{
    "Electricity": [{
      "level2": [{
        "Electricity, gas & steam production & supply": [{
          "level3": [{
            "Electric power generation, transmission and distribution": [{
              "level4": [
                "Electric power generation, transmission and distribution"
              ]
            }],
            "Manufacture of gas; distribution of gaseous fuels through mains": [{
              "level4": [
                "Manufacture of gas; distribution of gaseous fuels through mains"
              ]
            }],
            "Steam and air conditioning supply": [{
              "level4": [
                "Steam and air conditioning supply"
              ]
            }]
          }]
        }]
      }]
    }],
    "Manufacturing": [{
      "level2": [{
        "Manufacture of basic metals": [{
          "level3": [{
            "Casting of metals": [{
              "level4": [
                "Casting of iron and steel",
                "Casting of non-ferrous metals"
              ]
            }],
            "Manufacture of basic iron and steel": [{
              "level4": [
                "Manufacture of basic iron and steel"
              ]
            }],
            "Manufacture of basic precious and other non-ferrous metals": [{
              "level4": [
                "Manufacture of basic precious and other non-ferrous metals"
              ]
            }]
          }]
        }]
      }]
    }]
  }]
}

console.clear();
//console.log(Object.keys(sectors.level1));

//How to get to level4 node and read its value
console.log(sectors.level1);

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda