Refactoring#7
Open
Konstantin Minevskiy (kminevskiy) wants to merge 7 commits intowillowtreeapps:masterfrom
Open
Refactoring#7Konstantin Minevskiy (kminevskiy) wants to merge 7 commits intowillowtreeapps:masterfrom
Konstantin Minevskiy (kminevskiy) wants to merge 7 commits intowillowtreeapps:masterfrom
Conversation
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.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.