-
Notifications
You must be signed in to change notification settings - Fork 2
made task #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
base: master
Are you sure you want to change the base?
made task #1
Conversation
tasks/basics/nodeTask.js
Outdated
| class ArrayAdvanced extends Array { | ||
| constructor(array) { | ||
| super(); | ||
| this.array = array.slice(); |
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.
Конструктор нужно переписать. Он должен иметь тот-же контракт, что и обычный Array. Сейчас - это объект со свойством array
tasks/basics/nodeTask.js
Outdated
| this.array = array.slice(); | ||
| } | ||
| specialSort(collection) { | ||
| if (collection.hasOwnProperty('sort')) collection.sort(this.array); |
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.
как функция сортировки будет сортировать один элемент массива?
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.
Почитай про колбек в Array.prototype.filter: https://www.ecma-international.org/ecma-262/8.0/#sec-array.prototype.filter
machendos
left a comment
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.
Всё ок, только куда делся фильтр?)
|
Как тебе такое Илон Маск? Функциональность и подход к задаче |
|
Переименуй класс в |
|
методы в unsideTransform для неизменяющего массив метода, метод не изменяет массив в классе? он возвращает новый измененный массив? |
|
Он не изменяет массив, однако возвращает массив-результат: первый и/или последний элемент массива, или вообще пустой массив |
|
Можно реализовать только один, но назови его правильно |
|
А файл в |

Гит Игнор не ставил на лог файл, а так сделал как понял, жду вразумительных ревьюх.