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

152
Views
Cómo contar los números de línea totales de un objeto en Javascript

Quiero el número total de líneas de un archivo de objeto. ¿Cómo es esto posible?

let count = Object.keys(obj).length Con esto puedo obtener el valor de la clave, pero no dará la clave secundaria como "products"

En este ejemplo, el número total de líneas es 22

 { "device-native-resolution": "1920x1080", "discount": { "amount": "52.00", "applicable": true }, "email": "ddeech8e@gmail.com", "order_id": 4248349409343, "previous-vists": 3, "products": [ { "gift_card": false, "line_price": "0.00", "name": "Totebag", "price": "0.00", "product_id": 4567, "quantity": 1 } ] }
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!