Skip to content

Conversation

@kminevskiy
Copy link

No description provided.

Konstantin M added 7 commits December 6, 2017 11:33
Change getFirstName and getImageUrl function definitions syntax to match other function definitions (ES5)
Fix: slice function should take 0 instead of 1.
Readability: define (without initialization) variables on a separate line (tmp, j, i) on top of current scope
Readability: define AND initialize variables on a separate line (len, result)
Fix: set len to list.length instead of list.length - 1. This way we are not leaving the element at last index behind
Structure: change loop conditions a bit, functionality stays the same
Fix: modify the copy of the original list, not the original list itself
Readability: use ES5 syntax for a function parameter (since that's what we've been using earlier)
Fix: slice function should take 0 instead of 1
Structure: sort() takes ES5 anonymous function (ES5)
Structure: simplify if conditions
Fix: last return statement should be 0
Addition: add helper function sortByLastName that returns another function with lastName set as a sorting criterion
Readability: rename sortByLastName to sortDescendingByLastName to better reflect the intention of code inside it
Structure: call sortByLastName with reverse() inside sortDescendingByLastName
Readability: overall refactoring
Structure: return fetch Promise object instead of Promise that wraps fetch
Addition: return actual error instead of a not very descriptive Error! string
…make any suggestions without simply guessing.
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.

1 participant