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

задача 3.1 не доделана, не проходит 1 тест. задачи 3.2-3.3 выполнены #4

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

osvetilka
Copy link
Contributor

прошу проверять со всей строгостью
Задачи 3.2-3.4 выполнены.
Задача 3.1 не доделана не проходит 1 тест. Не успела доделать. Завтра не успеваю доделать, т.к. работаю.
Можно ли доделать к следующему уроку?

@jsru-1
Copy link
Contributor

jsru-1 commented Feb 2, 2025

Проверьте, пожалуйста, ваше решение, не все тесты прошли (PR не будет принят до тех пор, пока все добавленные задачи не будут решены).

@jsru-1
Copy link
Contributor

jsru-1 commented Feb 2, 2025

Добавляю преподавателя (@ufocoder) для код-ревью.

@@ -4,5 +4,9 @@
* @returns {object | undefined} - returns new object or undefined if nothing did't pass
*/
export function invertObj(obj) {
if (obj === undefined)
Copy link

Choose a reason for hiding this comment

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

if (!obj) {
 return;
}

if (string[i] === string[i-1]) {
n++;
}
else n = 1;
Copy link

Choose a reason for hiding this comment

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

лучше не опускать скобки в if/else для повышения читаемости

const arr = path.split('.');

return function(obj) {
if (!obj.hasOwnProperty(arr[0])) return ;
Copy link

Choose a reason for hiding this comment

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

Почему проверка идет только для первого элемента? Кажется что это условие можно опустить, у вас ниже похожая работа но в reduce

Copy link

Choose a reason for hiding this comment

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

Попробуйте избавиться от этой строки

Copy link

@ufocoder ufocoder left a comment

Choose a reason for hiding this comment

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

Улучшения можно прислать в рамках следующего PR

@jsru-1 jsru-1 merged commit adaae70 into js-tasks-ru:master Feb 5, 2025
1 check passed

const arr = Object.entries(obj);
return Object.fromEntries(arr.map(([keys,values])=>[values,keys]));
Copy link

Choose a reason for hiding this comment

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

опечатка? [key, value]

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