#Javascript .sort() method doubt

5 messages · Page 1 of 1 (latest)

stone shoal
#

For some reason the .sort method used in line number 17 isn't sorting the map according to the values , and am unable to figure out why is it so , any help would be greatly appreciated ....

real spear
#

Could you give more detail or share the code by pasting it here so others could run it to see what's happening?

reef kayak
#

the predicate of sort is supposed to return a number not a boolean

#

thats my guess of the problem you having... cus it uses the cases of having positive numbers/0/negative numbers to sort

#

which aint gonna happen with boolean