Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!