-
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
task solution #2686
base: master
Are you sure you want to change the base?
task solution #2686
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.
Almost done!
src/convertToObject.js
Outdated
const property = parts[0]; | ||
const value = parts[1]; |
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's better to use arrays destructuring as it will make a code shorter
const property = parts[0]; | |
const value = parts[1]; | |
const [property, value] = parts; |
src/convertToObject.js
Outdated
* | ||
* @param {string} sourceString | ||
* | ||
* @return {object} | ||
*/ | ||
function convertToObject(sourceString) { | ||
// write your code here | ||
const cssObject = {}; | ||
const lines = sourceString.split('\n'); |
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.
we can simplify the logic and split by the ;
like that? |
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!
No description provided.