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

225
Views
Set all false values ​of javascript Object to true

I want to select all Object arrays in selectOrderStatus and change all selected: false and true values ​​to true.

I want to set all selected object values ​​to true through the ActivateAllArrays function event when the checkbox is clicked using an input checkbox.

console.log(selectOrderStatus); 
const selectOrderStatus = [
    {
        selected: false,
        id: 1, 
        payment: 1234
    },
    {
        selected: false,
        id: 2, 
        payment: 12345
    },
    {
        selected: false,
        id: 3, 
        payment: 12344
    },
    {
        selected: true,
        id: 4, 
        payment: 123452
    },
    {
        selected: false,
        id: 5, 
        payment: 12341
    },
]
       <input 
              type="checkbox"
              onChange={(e) => ActivateAllArrays(e)}
            />

I don't know how to write code in ActivateAllArrays function. I googled all day to find it, but an error kept coming up and I had to ask.

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

0

you've asked a similar question before. someone already gave you a good answer involving map

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!