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

решение задач 2 модуля #2

Merged
merged 11 commits into from
Jan 26, 2025

Conversation

NastasiaMat
Copy link
Contributor

@NastasiaMat NastasiaMat commented Jan 26, 2025

Разработаны:

  1. сортировка с учетом регистра и алфавита (sortStrings)

  2. функция получения отсортированного объекта по перечисленным ключам (pick)

  3. функция получения отсортированного объекта по не вошедшим в перечисление ключам (omit)

  4. вышло как-то топорно, но не смогла придумать ничего другого (createGetter)

@jsru-1
Copy link
Contributor

jsru-1 commented Jan 26, 2025

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

@jsru-1
Copy link
Contributor

jsru-1 commented Jan 26, 2025

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

@NastasiaMat
Copy link
Contributor Author

А, вот как работает синхронизация)

@@ -5,5 +5,9 @@
* @returns {object} - returns the new object
*/
export const pick = (obj, ...fields) => {
const result = {};

fields.map((item) => result[item] = obj[item]);

Choose a reason for hiding this comment

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

Не используйте map, используйте forEach или другой способ обхода массива

@@ -5,5 +5,9 @@
* @returns {object} - returns the new object
*/
export const omit = (obj, ...fields) => {
const newObj = obj;

fields.map((item) => delete newObj[item]);

Choose a reason for hiding this comment

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

Не используйте map, используйте forEach или другой способ обхода массива

@jsru-1
Copy link
Contributor

jsru-1 commented Jan 26, 2025

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

@jsru-1 jsru-1 requested a review from ufocoder January 26, 2025 20:29
@jsru-1 jsru-1 merged commit af71571 into js-tasks-ru:master Jan 26, 2025
1 check passed
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