-
Notifications
You must be signed in to change notification settings - Fork 2.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 #2284
base: master
Are you sure you want to change the base?
Solution #2284
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.
I've found 3 cases of checklist violation, see if there be more, I'm not sure :)
src/transformState.js
Outdated
}; | ||
|
||
if (actions[i][key] === 'removeProperties') { | ||
for (const key1 in actions[i]['keysToRemove']) { |
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.
according to the checklist: 1. [CODE STYLE]: don't use for in loop for iterating over array
src/transformState.js
Outdated
function transformState(state, actions) { | ||
// write code here | ||
for (let i = 0; i < actions.length; i++) { | ||
for (const key in actions[i]) { |
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.
according to checklist 5. [CODE STYLE]: Nested loops === EVIL.
Avoid evil ;)
src/transformState.js
Outdated
// write code here | ||
for (let i = 0; i < actions.length; i++) { | ||
for (const key in actions[i]) { | ||
if (actions[i][key] === 'addProperties') { |
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.
according to the checklist: 2. [CODE STYLE]: Use switch statement if you have limited amount of conditions.
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.
lookin' all good, only one small improvement suggested :)
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 job ✅
No description provided.