Skip to content
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

Solution #3751

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Solution #3751

wants to merge 2 commits into from

Conversation

o-koszalka
Copy link

No description provided.

Copy link

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

Choose a reason for hiding this comment

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

It looks like there are a couple of critical issues that need to be addressed before we can approve this pull request. The use of the division operator / instead of the assignment operator = is causing a syntax error, which is a critical issue as it affects the functionality of the code. Additionally, there's an unnecessary comma that should be removed to prevent syntax errors. Once these issues are resolved, your solution will be in great shape! Keep up the good work and don't hesitate to reach out if you need any help. 😊

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

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

@@ -6,7 +6,19 @@
* @return {object}
*/
function convertToObject(sourceString) {
// write your code here
const sourceStringToArray = sourceString

Choose a reason for hiding this comment

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

There is a syntax error here. The division operator / is incorrectly used instead of the assignment operator =. It should be const sourceStringToArray = sourceString.

const [key, value] = item.split(':', 2);

return [key.trim(), value.trim()];
}),

Choose a reason for hiding this comment

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

There is an unnecessary comma at the end of this line. It should be removed to avoid syntax errors.

Copy link

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

Choose a reason for hiding this comment

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

Review Summary

Great job on implementing the convertToObject function! 🎉 Your solution effectively meets the task requirements by converting a string of CSS styles into an object with CSS declarations as keys and values. You've used array methods like split, map, and filter appropriately, and your variable names are descriptive, which enhances code readability.

However, there are a couple of critical issues that need attention:

  1. Syntax Error: You've used the division operator / instead of the assignment operator =. This will cause a syntax error and affect the functionality of your code. Please replace / with = to correctly assign the result of sourceString.split(';') to sourceStringToArray.

  2. Unnecessary Comma: There's an unnecessary comma in your code that should be removed to prevent syntax errors.

Addressing these issues will improve your code and help you avoid similar problems in the future. Remember, learning from mistakes is a crucial part of the development process. Keep up the great work and continue refining your skills! 🚀

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

@@ -6,7 +6,19 @@
* @return {object}
*/
function convertToObject(sourceString) {
// write your code here
const sourceStringToArray = sourceString

Choose a reason for hiding this comment

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

There is a critical issue here: the division operator / is used instead of the assignment operator =. This will cause a syntax error. You should replace / with = to assign the result of sourceString.split(';') to sourceStringToArray.

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