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

118
Views
How to filter object? Problem with nested values

Technically, I know how to filter in reactjs, but now I want to go a little further and filter something more advance. Using this method I can filter on the json but I have problem to access to price

//work fine
{product.filter(person => person.id >1)).map(filteredPerson =>  (
 <li>
     { filteredPerson.name }
    </li>)) }
// 'person.cena.includes' is undefined)
{product.filter(person => person.cena.includes("100kw")).map(filteredPerson =>  (
 <li>
     { filteredPerson.name }
    </li>)) }



const product = [{name: "abc",
id: 0,
price: {
"100kW": 3432,
"200kW": 4345,
"300kW": 5456}},
{name: "cba",
id: 1,
price: {
"100kW": 2222,
"200kW": 3333,
"300kW": 4444}}] 

My goal is to achieve datatable like this: id/name/type/price 0/abc/6kw/2222/ 0/abc/8kw/3333

because I want to use if statement (in this filter method)

var maxSize = Math.ceil(power/effecienty*1.3)
var minSize = Math.ceil(power/effecienty*0.7)
if(minSize> 4 && maxSize < 8){ return product.cena.includes('6kW')}
if(minSize> 6 && maxSize < 10){ return product.cena.includes('8kW')}
...

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!