-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
Проверьте, пожалуйста, ваше решение, не все тесты прошли (PR не будет принят до тех пор, пока все добавленные задачи не будут решены). |
Добавляю преподавателя (@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) |
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.
if (!obj) {
return;
}
if (string[i] === string[i-1]) { | ||
n++; | ||
} | ||
else n = 1; |
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.
лучше не опускать скобки в if/else для повышения читаемости
const arr = path.split('.'); | ||
|
||
return function(obj) { | ||
if (!obj.hasOwnProperty(arr[0])) return ; |
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.
Почему проверка идет только для первого элемента? Кажется что это условие можно опустить, у вас ниже похожая работа но в reduce
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.
Попробуйте избавиться от этой строки
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.
Улучшения можно прислать в рамках следующего PR
|
||
const arr = Object.entries(obj); | ||
return Object.fromEntries(arr.map(([keys,values])=>[values,keys])); |
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.
опечатка? [key, value]
прошу проверять со всей строгостью
Задачи 3.2-3.4 выполнены.
Задача 3.1 не доделана не проходит 1 тест. Не успела доделать. Завтра не успеваю доделать, т.к. работаю.
Можно ли доделать к следующему уроку?