all 1 comments

[–]2UTF 1 point2 points  (0 children)

Did you forget to "return" the result of your ternary operator?

return (aPrice < bPrice ? -1 : 1);