-
Notifications
You must be signed in to change notification settings - Fork 195
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
Added static Immutable.sortBy(array[, sorter]) function #211
base: master
Are you sure you want to change the base?
Conversation
I'm unsure how to address the build issues in Travis. Can someone assist? |
would prefer if no change after sort, return the same reference |
c3a78f1
to
7eecb31
Compare
What's going on with this Travis build? I'm still unable to proceed. |
Build log mentions zuul. Probably related to saucelabs: #249 (comment) |
|
||
for (i = 0, length = array.length; i < length; i++) { | ||
result.push(array[i]); | ||
} |
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.
Why not use asMutable()
instead of making a mutable copy manually?
// Check if both are NaN. Type checks catch cases where isNaN returns true for strings. | ||
if(!(typeof result[i] === "number" && isNaN(result[i]) && typeof array[i] === "number" && isNaN(array[i]))) { | ||
rearranged = true; | ||
} |
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.
should break
here
@pekeler would this this pull request be ready to merge if the remaining review comments were resolved? |
Adds a static sortBy function to the Immutable object. It exposes the basic JS Array#sort functionality. It can take an optional sorting function as per Array#sort.