• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

162
Views
How to set dynamically array object to the for loop in javascript when for loop iterates

I need to set my for loop length dynamically.

I have an object array.enter image description here

After my condition is true, I need to set dynamically objects in my permission array inside for loop.

Heare is my code:

if (obj[k]===pathData[i]){
         //pathData[i]=order
        for (let l = 0; l <permission[j].pathData[i].statusChange.length; l+=1) {
              
             } 
          }

My code is not working...I really need your help.

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

0

var permissionObjKeys = Object.keys(permissions[j])
         for(permissionObjKey of permissionObjKeys){
            permissions[j][permissionObjKey].statusChange.push('new-permission')
         } 

try this it will work inside the dynamic object present in the permission array.

about 3 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 Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error