javascript – Problems with sort() and knockoutjs

Question:

https://jsfiddle.net/n8v3hj5n/1/

I'm having trouble sorting an observableArray of knockoutjs, every time I order the list it gives a reversal() effect.

Who asks to solve this problem?

Answer:

Well, the parameter a and b of sort is an object, so you should call the function as the number is an observable 🙂

Here's a working example, I hope you understand what the error was!

https://jsfiddle.net/n8v3hj5n/2/

Scroll to Top
AllEscort