Basically the problem is that you iterate through your array using a for in loop, which is not designed to iterate through arrays. Its purpose is to iterate over all the properties of the object, and there appears to be a property in your array called remove .
For more information about why for in is a bad idea when it comes to arrays, see Why is using "for ... in" with array iteration a bad idea? .
As a solution, I would suggest using an indexed for loop. This type of loop does not care about properties, therefore you are fine. So this basically boils down to very classic:
for (var i = 0; i < data.List; i++) { console.log(data.List[i]); }
By the way: you shouldn’t make out anything in JavaScript, unless it is a constructor function. Therefore, it should be data.list .
PS: nice to read when it comes to arrays and (incorrectly) using them, read Fun with JavaScript Arrays , nice to read.
source share