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

73
Views
Compare nested key names in JavaScript

I need to compare complex objects. i.e:

const obj1 = {
  data1: [{ nestedKeyLevel1: ['text1'] }],
  data2: [{ nestedKeyLevel1: [{ nestedKeyLevel2: ['text2'] }] }]
};

const obj2 = 
  {
    data1: [{ differentKeyName: ['text1'] }],
    data2: [{ nestedKeyLevel1: [{ nestedKeyLevel2: ['text2'] }] }]
  }
;

I need to compare the object and get a boolean value of either their key names (not values are equal.

Meaning in the example above, the result will be false as the key name in obj1.data1[0] is different than the key name in obj2.data1[0].

How can I do it?

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!