I have an 2d array created thats 50 by 2 and want to fill it with a passed array. I know the array works and the passed variables. But I can’t get the passed variable to fill up the array, it just fills with plain text. Is my syntax wrong?
for (i=0; i <50; i++){
basket[i]=new Array(2);
}
function addtobasket(itemname, itemvalue){
basket[itemcount][itemcount]='itemname itemvalue;'
}
TIA!
'itemname itemvalue'will just fill the array with ‘itemname itemvalue’So you need to write:
Don’t forget to put the semicolon AFTER the string.