I have a coding challenge where I need to output a specific set of hobbies for each day of the week. The desired result is as follows:
My hobbies on Mondays are Poker, VideoGames
My hobbies on Tuesday are Board Games, Hiking, Rockclimbing
My hobbies on Wednesdays are Driving, Shopping
I've been trying to accomplish this using nested for loops, but I'm encountering some difficulties. While I can successfully list out the weekdays, I'm struggling to access and display all elements of the multi-dimensional hobbies array corresponding to each day.
Is there anyone who could provide guidance on how to achieve this?
var hobbies = ['Poker','VideoGames'];
['Board Games', 'Hiking', 'Rockclimbing'];
['Driving', 'Shopping'];
const weekdays = ["Monday", "Tuesday", "Wednesday"];
for (i = 0; i < 3; i++) {
console.log("My hobbies on", weekdays[i], "are ");
for (x = 0; x < 5; x++)
console.log(hobbies[?]);
}