So I am new to programming and I have this project that need to be done and I have to use these codes in my web interface. However I am unable to find what function to use to display these codes with the movies heading. Anybody can help please?
This is the code that I need to use. But idk how to display it. I have to make it sortable by year afterwards.
let movieData = {
"The Darjeeling Limited": {
plot: "A year after their father's funeral, three brothers travel across India by train in an attempt to bond with each other.",
cast: ["Jason Schwartzman", "Owen Wilson", "Adrien Brody"],
runtime: 151,
rating: 7.2,
year: 2007,
},
"The Royal Tenenbaums": {
plot: "The eccentric members of a dysfunctional family reluctantly gather under the same roof for various reasons",
rating: 7.6,
year: 2001,
cast: ["Gene Hackman", "Gwnyeth Paltrow", "Anjelica Huston"],
runtime: 170,
},
"Fantastic Mr. Fox": {
year: 2009,
plot: "An urbane fox cannot resist returning to his farm raiding ways and then must help his community survive the farmers' retaliation.",
cast: ["George Clooney", "Meryl Streep", "Bill Murray", "Jason Schwartzman",],
runtime: 147,
rating: 7.9,
},
"The Grand Budapest Hotel": {
rating: 8.1,
runtime: 159,
year: 2014,
plot: "A writer encounters the owner of an aging high-class hotel, who tells him of his early years serving as a lobby boy in the hotel's glorious years under an exceptional concierge.",
cast: ["Ralph Fiennes", "F. Murray Abraham", "Mathieu Amalric"],
},
};
document.getElementById("demo").innerHTML = movieData.plot + movieData.cast
<p id="demo"></p>