-
Notifications
You must be signed in to change notification settings - Fork 1.7k
first update #1783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
first update #1783
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| 'use strict'; | ||
|
|
||
| //const { createElement } = require("react"); | ||
|
|
||
| const food = { | ||
| Drink: { | ||
| Wine: {}, | ||
|
|
@@ -21,7 +23,22 @@ const food = { | |
| const tree = document.querySelector('#tree'); | ||
|
|
||
| function createTree(element, data) { | ||
| // WRITE YOUR CODE HERE | ||
|
|
||
| if (!data || typeof data !== 'object') return; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This guard correctly prevents processing non-object |
||
| if (!data || !Object.keys(data).length) return; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This early return is the right fix to avoid creating |
||
|
|
||
| const ul = document.createElement('ul'); | ||
|
Comment on lines
+27
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| for (const objs in data) { | ||
| const newel = document.createElement('li'); | ||
| newel.textContent = objs; | ||
|
|
||
| createTree(newel, data[objs]); | ||
|
Comment on lines
+32
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This |
||
|
|
||
| ul.append(newel); | ||
| } | ||
|
|
||
| element.append(ul); | ||
| } | ||
|
|
||
| createTree(tree, food); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The task guideline expects the main SCSS to be linked in a way Parcel can treat it as the entry (e.g.,
href="./styles/main.scss"fromsrc/index.html), and the previous review explicitly required ensuring a realsrc/styles/main.scssfile exists. Right now the link usessrc/styles/main.scss, and there’s no evidence that this file exists or that the path matches the expected setup. Please confirm the stylesheet file is present undersrc/styles/and adjust thehrefto the correct relative path so Parcel can compile and apply the styles as intended.