Seems that this solution can't be used like a common solution, see tests here http://stackoverflow.com/a/34466248/3429127.
That means that you should avoid usage of ">" and "<" in comparator.
Just want to notice that JS native sort method affects on initial array.
If we want that list argument stays the same we need to make a copy of it inside the function (e. g. using slice()).
We can.
Correct syntax would be
this.valueOf = () => value
.Needs random tests
It's clear though. It's a suggestion, not an issue ;-)
Not an issue ;-)
It's clear though. It's a suggestion, not an issue ;-)
Not an issue ;-)
Awesome! I'm finally starting to understand apply() better.
great detaild explanation!
This comment is hidden because it contains spoiler information about the solution
This duplicates the "Function Cache" kata: http://www.codewars.com/kata/525481903700c1a1ff0000e1/. The exact same solution works for both.
Seems that this solution can't be used like a common solution, see tests here http://stackoverflow.com/a/34466248/3429127.
That means that you should avoid usage of ">" and "<" in comparator.
Just want to notice that JS native sort method affects on initial array.
If we want that list argument stays the same we need to make a copy of it inside the function (e. g. using slice()).
@schm0 Not sure what you mean - this is native JS, not Underscore.
Everything looks good, could be improved by adding a few test cases
Can't understand what this is all about. Some more details instructions would make this more fun.
Loading more items...