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

create #2651

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

create #2651

wants to merge 2 commits into from

Conversation

LeoSpartaDeV
Copy link

No description provided.

Comment on lines 10 to 21
const sourceArr = sourceString.split('');

let sourseArr = sourceArr.filter((item, i) => {
if (item === '\n' || (item === ' ' && sourceArr[i - 1] === ' ')) {
return false;
}

return true;
});

sourseArr = sourseArr.join('');
sourseArr = sourseArr.split(';');

Choose a reason for hiding this comment

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

we can just split it by ';'

Choose a reason for hiding this comment

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

and then remove spaces using the trim method

Copy link
Author

Choose a reason for hiding this comment

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

thanks, I went step by step, through the debugger and the console, and confused myself

Copy link

@IvanFesenko IvanFesenko left a comment

Choose a reason for hiding this comment

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

Pay attention on code style

const sourceArr = sourceString.split(';');

sourceArr.forEach((elem) => {
const LastIndOfKey = elem.indexOf(':');

Choose a reason for hiding this comment

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

camelCase

Suggested change
const LastIndOfKey = elem.indexOf(':');
const lastIndOfKey = elem.indexOf(':');

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