R
Reactiflux

Script – 23-27 Jan 30

Script – 23-27 Jan 30

SScript1/30/2022
I'm not understanding this kind of sorting arr = arr.sort((a, b) => a < b ? 1 : -1); What does 1, -1 mean?
SScriptyChris1/30/2022
-1 goes for < 0
UUUnknown User1/30/2022
Message Not Public
Sign In & Join Server To View
Llebouwski1/30/2022
if its for numbers you can just do (a, b) => a - b
SScript1/31/2022
yh thats the one I'm familiar with So I got confused when I saw the ternary with 1 and -1. Thanks
UUUnknown User1/31/2022
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

Script – 23-27 Jan 30

Join Server