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

101
Views
Compare the two array of objects and render the non- matching values in react

let states =[{name:"goa", Population:1000 },{ name:"maharashtra", population : 100000 }, { name:"Kerala", Population:1000 },{ name:"Delhi", population : 100000 }, {name:"Kolkata", Population:1000 },{ name:"UP", population : 100000 }, { name:"Sikkim", Population:1000 },{name:"Ladakh", population : 100000 }];

let Covid_count=[{ name:"Kolkata", patients:20 },{ name:"UP", patients : 100 }, { name:"Sikkim", patients:10 },{ name:"Ladakh", patients : 10 }]

Display state names which does not have covid patients.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

list of the ones with Covid:

var states =[{"name":"goa","Population":1000},{"name":"maharashtra","population":100000},{"name":"Kerala","Population":1000},{"name":"Delhi","population":100000},{"name":"Kolkata","Population":1000},{"name":"UP","population":100000},{"name":"Sikkim","Population":1000},{"name":"Ladakh","population":100000}]

var Covid_count = [{"name":"Kolkata","patients":20},{"name":"UP","patients":100},{"name":"Sikkim","patients":10},{"name":"Ladakh","patients":10}];

states.forEach((x)=>{
  if(Covid_count.find((item)=> item.name==x.name))
    console.log(x)
})

List of the ones not having covid:

var states =[{"name":"goa","Population":1000},{"name":"maharashtra","population":100000},{"name":"Kerala","Population":1000},{"name":"Delhi","population":100000},{"name":"Kolkata","Population":1000},{"name":"UP","population":100000},{"name":"Sikkim","Population":1000},{"name":"Ladakh","population":100000}]

var Covid_count = [{"name":"Kolkata","patients":20},{"name":"UP","patients":100},{"name":"Sikkim","patients":10},{"name":"Ladakh","patients":10}];

states.forEach((x)=>{
  if(!Covid_count.find((item)=> item.name==x.name))
    console.log(x)
})
about 4 years ago · Juan Pablo Isaza Report
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!