Hello everyone I have a small question about array in array and how to call it…
EX:
var plotName = ['bearShevaPlot', 'haifaPlot', 'tiberiasPlot', 'kfarSabaPlot', 'netanyaPlot', 'rishonLezionPlot', 'rehovotPlot', 'telAvivPlot'];
var chartName = ['bearShevaCity', 'haifaCity', 'tiberiasCity', 'kfarSabaCity', 'netanyaCity', 'rishonLezionCity', 'rehovotCity', 'telAvivCity'];
to call all of the array and preform a function on each of them i’ll use .each jQuery function.
$.each(plotName,function(cName,pName){
chartName[cName];
var pName = $.jqplot(''+chartName[cName]+'', [/* another var */], {
//my code here
});
});
Now because i need to have a 3rd var I want to have an array inside an array like:
var plotName = [['bearShevaPlot', 'bearSheva'], ['haifaPlot', 'haifa'], ['tiberiasPlot', 'tiberias'], ['kfarSabaPlot', 'kfarSaba'], ['netanyaPlot', 'netanya'], ['rishonLezionPlot', 'rishonLezion'], ['rehovotPlot', 'rehovot'], ['telAvivPlot', 'telAviv']];
and my question is how can i call “bearSheva” which is the second val of the first array inside the array.
Thanks for your help and sorry for my bad english 🙂
firstPlot&secondPlotwill have the desired values.Hope it helps.