I am filling an array with objects with push()
function. Then I'm passing as a parameter to customTimer
function in the end when I am in the customTimer
function i trying to access this array cells but i can't.
i tried a few things like refObjArr[0],refObjArr["0"]
etc.
When I'm trying to console.log("qweqew",typeof refObjArr)
it returns object and i tried console.log("Array : ",arr)
i can see objects but i can't access anyway
when Im using jQuery makeArray() function
var arr = $.makeArray(refObjArr)
console.log("custom Timer -> refObjArr : ", refObjArr)
console.log("custom Timer -> type arr: ", typeof arr)
console.log("custom Timer -> arr: ", arr)
console.log("is Array " + jQuery.isArray(arr));
it gives me true but i still can't acess
UPDATE :
for (var i = 0; i < detayBodyArray.length; i++) {
$.ajax({
type: "GET",
url: apiAdress + '/api/Gosterge/defParameters?ekrandetayId=' + detayId[i] + '&bodyIdIndex=' + i,
dataType: "json",
success: function (veri) {
n = detayId.indexOf(veri[2].ekrandetayId);
setRefObj[n] = {};
setRefObj[n].yS = parseInt(veri[2].value);
setRefObj[n].kS = parseInt(veri[2].value);
setRefObj[n].ekrandetayId = detayId[veri[2].index]
setRefObj[n].bodyId = bodyId[n];
setRefObj[n].gostergeTip = tip[n];
setRefObj[n].gostergeUrl = url[n];
setRefObj[n].gostergeUrlTip = urlTipi[n];
},
error: function (msg) {
alert(msg.responseText);
},
beforeSend: function (xhr, settings) { xhr.setRequestHeader('Authorization', 'Bearer ' + token); }
});
if (i === detayBodyArray.length - 1) {
customTimer();
}
}
detayBodyArray coming from another func., refObjArr is a global array