Consider the following array:
var data = {"result":"success","ids":["00000","54321","123","22222","11111","55555","33333","abc123","123abc","12345","44444"]}
localStorage.ids = data.ids;
However, when attempting to iterate through it using AngularJS:
angular.forEach(localStorage.ids, function(id, key) {
console.log(id);
});
The output is unexpected:
0
0
0
0
0
,
5
4
3
If we
console.log(JSON.stringify(localStorage.ids));
, we receive:
"00000,54321,123,22222,11111,55555,33333,abc123,123abc,12345,44444"
Can anyone shed some light on this behavior?