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

новое решение sortStrings #3

Merged
merged 7 commits into from
Jun 27, 2022

Conversation

elenakochegina
Copy link
Contributor

No description provided.

@jsru
Copy link
Contributor

jsru commented Jun 20, 2022

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

@jsru jsru requested a review from dosandk June 20, 2022 15:08
@jsru
Copy link
Contributor

jsru commented Jun 22, 2022

Решение было обновлено, посмотрим что скажет @dosandk

@@ -4,5 +4,16 @@
* @returns {function} - function-getter which allow get value from object by set path
*/
export function createGetter(path) {

const partsArray = path.split(".");
Copy link
Contributor

Choose a reason for hiding this comment

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

good 👍 лайк за использование замыкания

let value = {...obj};
for (let i = 0; i < partsArray.length; i++) {
if (typeof value[partsArray[i]] === 'undefined') {
return undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

нельзя напрямую возвращать undefined

@@ -4,5 +4,6 @@
* @returns {*[]} - the new array with uniq values
*/
export function uniq(arr) {

const uniq = new Set(arr);
return Array.from(uniq);
Copy link
Contributor

Choose a reason for hiding this comment

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

подумайте какие есть преимущества у Array.from по сравнению с спред-синтаксисом:

return [...new Set(arr)]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

знаю только, что для TypeScript нежелательное использования спред синтаксиса с Set

Copy link
Contributor

Choose a reason for hiding this comment

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

@elenakochegina почему нежелательно в TypeScript использовать спред с Set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsru
Copy link
Contributor

jsru commented Jun 25, 2022

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

@jsru jsru requested a review from dosandk June 25, 2022 10:24
Copy link
Contributor

@dosandk dosandk left a comment

Choose a reason for hiding this comment

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

👍 good

@jsru jsru merged commit 5fedd2f into js-tasks-ru:master Jun 27, 2022
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