()
| 55 | main.append(newArticle); |
| 56 | |
| 57 | const usedStatus = () => { |
| 58 | let age = everydayPack.backpackAge(); |
| 59 | let description; |
| 60 | if (age >= 30) { |
| 61 | if (age >= 365) { |
| 62 | if (age >= 1095) { |
| 63 | description = "old"; |
| 64 | } else { |
| 65 | description = "used"; |
| 66 | } |
| 67 | } else { |
| 68 | description = "lightly used"; |
| 69 | } |
| 70 | } else { |
| 71 | description = "new"; |
| 72 | } |
| 73 | |
| 74 | console.log(` |
| 75 | Age: ${age} days |
| 76 | Status: ${description} |
| 77 | `); |
| 78 | }; |
| 79 | |
| 80 | usedStatus() |