FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Козлов Александр by KozlovAlexanderS · Pull Request #63 · urfu-2016/javascript-task-4 · GitHub

Козлов Александр - #63

Open
KozlovAlexanderS wants to merge 1 commit into
urfu-2016:masterfrom
KozlovAlexanderS:master
Open

Козлов Александр#63
KozlovAlexanderS wants to merge 1 commit into
urfu-2016:masterfrom
KozlovAlexanderS:master

Conversation

Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

🍏 Пройдено тестов 15 из 15

Comment thread lego.js
var changedCollection = collection.map(function (el) {
return Object.assign({}, el);
});
functions.sort(function (first, second) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Для функции сортировки можно параметры называть a и b

Comment thread lego.js
var fieldsToChoose = [].slice.call(arguments);

return function select(collection) {
return collection.map(function (el) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

el не несет никакой семантики, лучше подойдет название вроде person

Comment thread lego.js

return function select(collection) {
return collection.map(function (el) {
return fieldsToChoose.reduce(function (newCollection, property) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Первый аргумент назвал newCollection, но ведь это не коллеция, а объект с информацией о человеке

Comment thread lego.js
console.info(property, values);

return;
return function filterIn(collection) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Снова el никак не отражает того, что лежит внутри (в общем везде el нужно поменять)

Comment thread lego.js

return;
return function sortBy(collection) {
var changedCollection = collection.sort(function (first, second) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Зачем еще одну переменную создавать? Можно просто collection.sort()

Comment thread lego.js
return function sortBy(collection) {
var changedCollection = collection.sort(function (first, second) {

return (first[property] > second[property]);

ninjagrizzly Nov 4, 2016
edited
Loading

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Функция сравнения должна возвращать 1 (если first > second по некоторому критерию), 0 (если равны) и -1 (если меньше)

Copy link
Copy Markdown

🍅

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL