-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathscript.js
More file actions
executable file
·40 lines (36 loc) · 1.04 KB
/
script.js
File metadata and controls
executable file
·40 lines (36 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* Use template literals to output HTML
* @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
*
*/
import Backpack from "./Backpack.js";
const everydayPack = new Backpack(
"Everyday Pack",
30,
"grey",
15,
26,
26,
false,
"December 5, 2018 15:00:00 PST"
);
const content = `
<main>
<article>
<h1>${everydayPack.name}</h1>
<ul>
<li>Volume: ${everydayPack.volume}</li>
<li>Color: ${everydayPack.color}</li>
<li>Age: ${everydayPack.backpackAge()}</li>
<li>Number of pockets: ${everydayPack.pocketNum}</li>
<li>Left strap length: ${everydayPack.strapLength.left}</li>
<li>Right strap length: ${everydayPack.strapLength.right}</li>
<li>Lid status: ${everydayPack.lidOpen}</li>
</ul>
</article>
</main>
`;
document.body.innerHTML = content;
console.log("The everydayPack object:", everydayPack);
console.log("The pocketNum value:", everydayPack.pocketNum);
console.log("Days since aquired:", everydayPack.backpackAge());