Hello guys and girls,
I have a problem with my 2D array: I do not find how to link the datas of an array with the other one
Here is my my 2D array (with 2 arrays : days and names):
var tabJDayName = [
['monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'],
[franck, arthur, fred, fabrice, rené, bernadette, eric]
];
I would like the console to show me this :
monday: franck
tuesday: arthur
wednesday: fred
and so on…
My latest test is (it gives me the day and then the name but it doesn’t maake couples out of it):
for(var i = 0; i<2; i++){
console.log(tabJDayName[j]);
}
}
I also tried this (which gives me the arrays and then their content):
for(var i = 0; i<tabJDayName.length; i++){
console.log(tabJDayName[i]);
for(var j = 0 ; j<tabJDayName[i].length; j++){
console.log(tabJDayName[i][j]);
}
}
If someone could help it would really be awesome for me !