knapsack
knapsack copied to clipboard
Fix the return value in the sort() function to follow the standard
The sort() function that's called after filtering the items was returning a boolean instead of 1
, -1
or 0
as it is specified in the standard. It happens to work in some versions of NodeJS and Firefox but not Chrome (the versions I tried at least).