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

245
Views
Cómo obtener un subcampo de un objeto javascript
data = { active: false address: { address_1: '123 Main St', address_2: 'Unit 1', city: 'San Diego', country: 'US', postal_code: '92126' } created_at: "2022-05-23T21:28:10.545Z" created_by: null id: 1 type: "physical" updated_at: "2022-05-28T08:09:08.337Z" warehouse_aliases: [] }

Tengo un objeto como el anterior, quiero acceder dinámicamente a data.address.country, digamos el valor dinámico x = "address.country". Sin embargo, cuando trato de obtener el valor como data[x], no funcionó. ¿Cómo puedo obtener el valor? Muchas gracias por cualquier respuesta :)

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!