Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Solution #2666

wants to merge 2 commits into from

Conversation

voronine
Copy link

@voronine voronine commented Aug 2, 2023

No description provided.

@@ -5,7 +5,32 @@
* @param {Object[]} actions
*/
function transformState(state, actions) {
// write code here
for (const i in actions) {
Copy link

@Vitalii-Petruk Vitalii-Petruk Aug 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. [checklist] Don't use for in loop for iterating over array.
  2. [checklist] Use proper variable names in your loops.

for (const i in actions) {
const action = actions[i];

if (!action.type) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. [checklist] Use switch statement if you have limited amount of conditions.
    Don't forget default case for error handling.

Copy link

@Vitalii-Petruk Vitalii-Petruk left a 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.

Copy link

@BudnikOleksii BudnikOleksii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants