Hello,
I have writen a javascript function to push object into an array. In my loop I do a console.log(myArray); to display the content of the array at each loop.
The problem is that in the console the data lengh is correct but not the content of the data. When I click on the arrow to expend the array and see the values, it show me all the values from the finished loop at each iteration instead of the current array content in those loops.
That's totally wrong and is not helpfull at all...
Here is a copy/paste of what i see in the console:
- (17) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, __ob__: Ct]
- 0: {…}
- 1: {…}
- 2: {…}
- 3: {…}
- 4: {…}
- 5: {…}
- 6: {…}
- 7: {…}
- 8: {…}
- 9: {…}
- 10: {…}
- 11: {…}
- 12: {…}
- 13: {…}
- 14: {…}
- 15: {…}
- 16: {…}
- 17: {…}
- 18: {…}
- 19: {…}
- 20: {…}
- length: 21
- __ob__: Ct {value: Array(21), dep: dt, vmCount: 0}
- __proto__: Array
As you can see, there should be 17 elements but it shows 20... not logic at all ...