[javascript]
function updateInfo(e) {
const info = document.getElementById("info");
const textOfCard = (i) => {
const text = [...e.target.closest("div.card").children][i].textContent;
return text;
};
const textOfInfo = (i, text) => {
[...info.children][i].children[1].textContent = text;
};
for (let i = 0; i <= 4; i++) {
let j = i + 2;
if (j >= 5) j++;
const cardText = textOfCard(j);
textOfInfo(i, cardText);
}
}
yeh function "card" ki details extract krke "info Tab" me update kr deta hai.
card ki jo details hai vo ek library named object array me bhi stored hai.
now I cant figure out ki har card ko apne movie object se kese link karu
(incredibly hard to add new features using this method)
Things i am not able to implement through this
changing the library array's objects property har jagah reflect ho jaye,
pura function html order par tika hai so there's that ;-;
i hope question dhang se smjaya hai mene lol.
here's the github repo