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

158
Views
How to count total line numbers of an object in Javascript

I want the total number of lines of an object file. How is this possible?

let count = Object.keys(obj).length With this I can get the key wise value but it will not give the sub key like "products"

In this example total number of lines is 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!