0

I am writing some code in javascript and getting below json. But, see in console it is showing 8 records but, once i expand it becomes 6.

Thats why in result is coming 6 thats why i am getting incorrect result.

Please have a look. Is there any way to solve this problem.

  (8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]
        0: {Id: "49", SepalLengthCm: "5.3", SepalWidthCm: "3.7", PetalLengthCm: "1.5", PetalWidthCm: "gama", …}
        1: {Id: "50", SepalLengthCm: "5", SepalWidthCm: "3.3", PetalLengthCm: "1.4", PetalWidthCm: "aaaa", …}
        2: {Id: "99", SepalLengthCm: "5.1", SepalWidthCm: "2.5", PetalLengthCm: "3", PetalWidthCm: "ashish", …}
        3: {Id: "100", SepalLengthCm: "5.7", SepalWidthCm: "2.8", PetalLengthCm: "4.1", PetalWidthCm: "ashish", …}
        4: {Id: "101", SepalLengthCm: "6.3", SepalWidthCm: "3.3", PetalLengthCm: "6", PetalWidthCm: "ajay", …}
        5: {Id: "102", SepalLengthCm: "5.8", SepalWidthCm: "2.7", PetalLengthCm: "5.1", PetalWidthCm: "ajay", …}
        length: 6
soubhagya
  • 788
  • 2
  • 12
  • 37
  • Generally in the browser console, it displays the current state of a variable, but when you expand the array, it will not show the value of the array when it was printed but the current value of the array. I would say that when your array was logged it was containing 8 items but when you expand it, there are only 6. – robinvrd Jun 17 '20 at 13:04
  • Related maybe? https://stackoverflow.com/q/42260524 – Alon Eitan Jun 17 '20 at 13:06

0 Answers0