After declaring an array called myclinicsID
using var myclinicsID = new Array();
, I added some data to it. When I use
alert(JSON.stringify(myclinicsID))
, the output is ["1","2","3","4"]
However, when I try to access this array in my function and check the console, it shows undefined. Is there an issue with my code like this?
getbarSeriesData(myclinicsID[0]['clinic_id'],data[i]['datemonths']);
I am trying to fetch the first element of myclinicsID which has a value of 1.