Console logging same array shows two different lengths

Viewed 23

Hi what is the difference between the array in picture1 and array in picture2? Why can't I use array.length for the array in the 1st image? If I wanted to convert it to how it is in the second image how do I do that? *NOTE: this.allMasterModeldata[allcondtionstring[i].fieldName] is the array that is in the images

enter image description here

image2: enter image description here

for (var i = 0; i < allcondtionstring.length; i++) {
      for (var j = 0; j < allcondtionstring[i]?.fieldValue.length; j++) {
       
 /*716*/       console.log(this.allMasterModeldata[allcondtionstring[i].fieldName]);
        console.log((this.allMasterModeldata[allcondtionstring[i].fieldName]).length);

          if(168!=allcondtionstring[i].fieldValue[j]){
            console.log(this.allConditionFieldValue);
            this.allMasterModeldata[allcondtionstring[i].fieldName].push(this.allConditionFieldValue);
          }
          else{
            this.allMasterModeldata[allcondtionstring[i].fieldName];
          }                   
  /*704*/        console.log(this.allMasterModeldata[allcondtionstring[i].fieldName]);
      console.log(this.allMasterModeldata[allcondtionstring[i].fieldName].length);

        }  
      }

Any help will be appreciated

0 Answers
Related