while (p < b.length)
{
alert(p);
var geocoder = new ymaps.geocode('"'+b[p].Adress+'"');
alert(p);
var j = 0;
alert(p);
test(b[p].name);
function test (name) {
var defer = $.Deferred();
geocoder.then(
function (res) {
alert(p);
var nearest = res.geoObjects.get(0);
nearest.properties.set('balloonContentBody', name);
myMap.geoObjects.add(res.geoObjects);
},
function (err) {
}
);
return defer.promise();
}
p++;
}