-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
base: master
Are you sure you want to change the base?
Solution #3751
Conversation
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.
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 |
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.
There is a syntax error here. The division operator /
is incorrectly used instead of the assignment operator =
. It should be const sourceStringToArray = sourceString
.
src/convertToObject.js
Outdated
const [key, value] = item.split(':', 2); | ||
|
||
return [key.trim(), value.trim()]; | ||
}), |
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.
There is an unnecessary comma at the end of this line. It should be removed to avoid syntax errors.
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.
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:
-
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 ofsourceString.split(';')
tosourceStringToArray
. -
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 |
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.
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
.
No description provided.