Skip to content

js-style-to-object 1.0#4982

Open
FRANCISCOPELEGRINI wants to merge 2 commits into
mate-academy:masterfrom
FRANCISCOPELEGRINI:master
Open

js-style-to-object 1.0#4982
FRANCISCOPELEGRINI wants to merge 2 commits into
mate-academy:masterfrom
FRANCISCOPELEGRINI:master

Conversation

@FRANCISCOPELEGRINI

Copy link
Copy Markdown

No description provided.

@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

I am approving your solution as an educational override so you can keep progressing while you refine your style and iteration techniques. You did a solid job correctly converting the style string into an object, handling whitespace, stray semicolons, and producing an object that strictly equals the example literal, which shows good understanding of string parsing and object construction.

There are a few checklist-related improvements to make next:

  • On src/convertToObject.js, the variable named result (around the top of the function) violates [CHECKLIST ITEM #2]; consider a more descriptive name like stylesObject to make the intent clearer.
  • The for...of loop over the rules array (middle of the function) goes against [CHECKLIST ITEM #5]; try replacing it with an iteration method such as reduce or forEach instead.
  • Inside that iteration, you are mutating an existing object by assigning properties to it, which conflicts with [CHECKLIST ITEM #1]; using reduce to return a newly built object (e.g. rules.reduce((styles, rule) => { ...; return styles; }, {})) will align better with the guidelines.

Overall, your logic is correct and well-structured; the main work left is to align with the checklist conventions, which is a great opportunity to practice functional-style iteration and clearer naming.


✨ 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/convertToObject.js Outdated
Comment thread src/convertToObject.js Outdated
Comment thread src/convertToObject.js Outdated
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