-
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 #2666
base: master
Are you sure you want to change the base?
Solution #2666
Conversation
src/transformState.js
Outdated
@@ -5,7 +5,32 @@ | |||
* @param {Object[]} actions | |||
*/ | |||
function transformState(state, actions) { | |||
// write code here | |||
for (const i in actions) { |
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.
- [checklist] Don't use for in loop for iterating over array.
- [checklist] Use proper variable names in your loops.
src/transformState.js
Outdated
for (const i in actions) { | ||
const action = actions[i]; | ||
|
||
if (!action.type) { |
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.
- [checklist] Use switch statement if you have limited amount of conditions.
Don't forget default case for error handling.
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! 👍
But you need to fix some mistakes.
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.
Nicely done🔥
No description provided.