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 #2738

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

Conversation

YuliiaUmantseva
Copy link

No description provided.

Copy link

@vlasiuksasha vlasiuksasha left a comment

Choose a reason for hiding this comment

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

check the comments

for (const action of actions) {
switch (action.type) {
case 'addProperties':
for (const data in action.extraData) {

Choose a reason for hiding this comment

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

The variable 'data' does not provide clarity on what it holds. Consider renaming it to something more meaningful like 'property'.

}
break;
case 'removeProperties':
for (const key of action.keysToRemove) {

Choose a reason for hiding this comment

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

The variable 'key' does not provide clarity on what it holds. Consider renaming it to something more meaningful like 'propertyName'.

@@ -5,7 +5,27 @@
* @param {Object[]} actions
*/
function transformState(state, actions) {
// write code here

Choose a reason for hiding this comment

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

Add a brief comment explaining what the function does, to improve code readability.

}
break;
case 'clear':
for (const key in state) {

Choose a reason for hiding this comment

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

The variable 'key' does not provide clarity on what it holds. Consider renaming it to something more meaningful like 'propertyName'.

switch (action.type) {
case 'addProperties':
for (const data in action.extraData) {
const prop = action.extraData[data];

Choose a reason for hiding this comment

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

The variable 'prop' does not provide clarity on what it holds. Consider renaming it to something more meaningful like 'value'.

Copy link

@VeronikaSynieokaia VeronikaSynieokaia left a comment

Choose a reason for hiding this comment

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

well 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.

4 participants