Skip to content

add task solution#1784

Open
s-slavets wants to merge 1 commit into
mate-academy:masterfrom
s-slavets:develop
Open

add task solution#1784
s-slavets wants to merge 1 commit into
mate-academy:masterfrom
s-slavets:develop

Conversation

@s-slavets

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your solution is approved because it correctly implements createTree(element, data) with recursion, builds the nested ul/li structure from the object’s keys, and integrates properly with the DOM and SCSS setup as required. Functionally, the tree is created as expected, and there are no clear blockers that would prevent the task from working for the specified input.

One small behavioral point to be aware of: in src/scripts/main.js (around the code that creates the ul), you currently append a <ul> even when data[key] has no child keys, which results in empty lists. If you see test failures around DOM structure, you can fix this by only creating/appending ul when Object.keys(data[key]).length > 0. Also, make sure you replace https://<your_account>.github.io/js_tree-from-object-DOM/ with your real GitHub username wherever it appears and run the required npm run test commands so you can catch any subtle issues early.

Overall, the core requirements are met and the implementation is clean and readable; the remaining points are minor refinements and process checks rather than blockers. Good job on getting the recursive tree-building logic working correctly.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread src/scripts/main.js
ul.append(li);
}

element.append(ul);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, even when data[key] has no properties, you still append a <ul> to this element, which will be empty. Depending on the tests/spec, you may need to skip creating/appending ul when there are no child keys to avoid empty lists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants