I suppose that is very basic question, but I don't really understand, why do I get different results. Inside function(data)
the map fills and show as filled. When I get out, it flushes.What is wrong? Strangely, first thing that I receive in my Chrome JS Console is console.log(map)
from inner function, not the last one, so they seem to be printed out in reverse order.
var map = {};
var deps = $.get("#####", function (data) {
$.each(data, function (tag, data) {
$.each(data, function (param, info) {
if (param == 'name')
map[tag] = param;
});
});
console.log(map)
});
console.log(map)