MCPcopy Create free account
hub / github.com/LinkedInLearning/javascript-essential-training-2832077 / addPack

Function addPack

08_03/script.js:13–24  ·  view source on GitHub ↗
(currentPack)

Source from the content-addressed store, hash-verified

11};
12
13const addPack = function (currentPack) {
14 const newArticle = document.createElement("article");
15 newArticle.innerHTML = `
16 <h1>${currentPack.name}</h1>
17 <ul>
18 <li>Volume: ${currentPack.volume}</li>
19 <li>Color: ${currentPack.color}</li>
20 <li>Number of pockets: ${currentPack.pocketNum}</li>
21 </ul>
22 `;
23 return newArticle;
24};
25
26const main = document.querySelector("main");
27main.append(addPack(greenPack));

Callers 1

script.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected