Hi,
I have the following array:
var movies = {
'Movie 1' : {'year' : 1977, 'genre' : 'Sci-fi'},
'Movie 2' : {'year' : 1990, 'genre' : 'Drama'},
'Movie 3' : {'year' : 2003, 'genre' : 'War'},
};
I want to loop through this array and display the info on the page like:
Movie 1 - 1977, Sci-fi
Movie 2 - 1990, Drama
Movie 3 - 2003, War
I can get info about single elements using
document.write(movies['Movie 1']['year']);
but I couldn’t do the loop.Thanks for any ideas.