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

Function usedStatus

08_13e/script.js:57–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55main.append(newArticle);
56
57const usedStatus = () => {
58 let age = everydayPack.backpackAge();
59 age = 1095
60 let description;
61
62 switch (true) {
63 case age < 30:
64 description = "new"
65 break;
66 case age >= 30 && age < 365:
67 description = "lightly used"
68 break;
69 case age >= 365 && age < 1095:
70 description ="used"
71 break;
72 case age >= 1095:
73 description = "old"
74 break;
75 default:
76 console.log(`There is no description for ${age}.`)
77 }
78
79 console.log(`
80 Age: ${age} days
81 Status: ${description}
82 `);
83};
84
85usedStatus()

Callers 1

script.jsFile · 0.70

Calls 1

backpackAgeMethod · 0.45

Tested by

no test coverage detected