I have an array like so:
var data = {"result":"success","ids":["00000","54321","123","22222","11111","55555","33333","abc123","123abc","12345","44444"]} localStorage.ids = data.ids;
But now when I do:
angular.forEach(localStorage.ids, function(id, key) { console.log(id); });
I get like:
0 0 0 0 0 , 5 4 3
And so on.
When I console.log(JSON.stringify(localStorage.ids));
I get:
"00000,54321,123,22222,11111,55555,33333,abc123,123abc,12345,44444"
Does anyone know why this would happen?
localStorage.ids
before theforEach
loop, or angular'sforEach
doesn't work as expected.