Skip to content

Conversation

@NovoselovaNatalia
Copy link

No description provided.

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

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

lego.js Outdated
exports.isStar = true;
exports.isStar = false;

var PRIORITET = ['filterIn', 'sortBy', 'select', 'limit', 'format'];
Copy link

Choose a reason for hiding this comment

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

Прочитай гайды по оформлению, пожалуйста. Нельзя называть переменные транслитом

lego.js Outdated

var PRIORITET = ['filterIn', 'sortBy', 'select', 'limit', 'format'];

function copyCollection(array) {
Copy link

Choose a reason for hiding this comment

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

array -- плохое название переменной
оно не отражает сути

lego.js Outdated

var PRIORITET = ['filterIn', 'sortBy', 'select', 'limit', 'format'];

function copyCollection(array) {
Copy link

@vetoshko vetoshko Nov 4, 2016

Choose a reason for hiding this comment

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

Ты тут возвращаешь значение, названия таких функций принято начинать со слова get

lego.js Outdated
exports.query = function (collection) {
return collection;
var copy = copyCollection(collection);
var func = [].slice.call(arguments, 1);
Copy link

Choose a reason for hiding this comment

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

func тоже непонятно название.

lego.js Outdated
*/
exports.query = function (collection) {
return collection;
var copy = copyCollection(collection);
Copy link

Choose a reason for hiding this comment

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

copy? Что можно понять по переменной, которая называется копия?

lego.js Outdated
exports.sortBy = function (property, order) {
console.info(property, order);
return function sortBy(collection) {
var newCollection = copyCollection(collection);
Copy link

Choose a reason for hiding this comment

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

Новая коллекция? Почему она новая? Чем отличается от старой?)

lego.js Outdated
console.info(property, formatter);
return function format(collection) {
return collection.map(function (element) {
var copy = Object.assign({}, element);
Copy link

Choose a reason for hiding this comment

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

С copy та же самая история, что и выше

@vetoshko
Copy link

vetoshko commented Nov 4, 2016

🍅

@honest-hrundel
Copy link

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

@NovoselovaNatalia
Copy link
Author

🍏

@vetoshko
Copy link

vetoshko commented Nov 6, 2016

🚀

@honest-hrundel honest-hrundel assigned hrundik and unassigned vetoshko Nov 6, 2016
Copy link

@hrundik hrundik left a comment

Choose a reason for hiding this comment

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

🍅

lego.js Outdated

function getCopyCollection(collection) {
return collection.map(function (element) {
return Object.assign({}, element);
Copy link

Choose a reason for hiding this comment

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

Object.assign -- это ES2015. Мы пока остаёмся в рамках ES5, так что эту функцию использовать нельзя

})
.forEach (function (query) {
copyCollection = query(copyCollection);
});
Copy link

Choose a reason for hiding this comment

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

В качестве упражнения можете этот кусочек переделать на reduce, тогда можно будет переменную copyCollection не изменять. Но тут я не настаиваю.

lego.js Outdated
}

return;
return first[property] < second[property];
Copy link

Choose a reason for hiding this comment

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

sort ожидает, что компаратор возвращает число. А у вас возвращается логическое значение. И все значения, для которых условие не выполняются, преобразуются в 0, означающее, что значения равны. Так что функция сортировки корректно у вас работать не будет.

lego.js Outdated
console.info(property, formatter);
return function format(collection) {
return collection.map(function (element) {
var copyCollection = Object.assign({}, element);
Copy link

Choose a reason for hiding this comment

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

Object.assign нельзя использовать

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

🍅 Не пройден линтинг или базовые тесты

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

@honest-hrundel
Copy link

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

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.

4 participants