hi friends when I m initializing multidimensional array I am getting error
can’t convert undefined to object
when i use push() method to assign value to array element instead of —> test[i][j]=’hi’;
then it returns error => test[i] undefined
the only thing i want is to intialize array with some dummy data
$(document).ready(function (){
// accordian......
$(function() {
$( "#accordion1" ).accordion();
});
syncMenu(function(group,subgroup,items){
grp=group;
sub_groups=subgroup;
sub_items=items;
});
// get data after parsing using ajax
getPacakage(function(temp){
sel_pkg_group=temp;
fillOptionList();
});
// intailizing array ...
for(var i=0;i<10;i++){
for(var j=0;j<2;j++){
test[i][j]='hi';
test[i][j]='hi';
}
}
});
testandtest[]are undefined, so you’ll need to define them first:Now you can use
push()to push values totest[i].