-
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 #3680
base: master
Are you sure you want to change the base?
solution #3680
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.
Great job! 🎉 Your implementation of the convertToObject
function meets all the task requirements and constraints perfectly. The code is clean, efficient, and well-structured. Keep up the excellent work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
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.
Good work 👍
const colonIndex = trimmedDecl.indexOf(':'); | ||
|
||
if (colonIndex === -1) { | ||
return accumulator; | ||
} | ||
|
||
const property = trimmedDecl.slice(0, colonIndex).trim(); | ||
const value = trimmedDecl.slice(colonIndex + 1).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.
You can use split
instead of indexOf
and slice
No description provided.