Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to sort from smallest number to largest number using table.sort()?[SOVLED]

Asked by 5 years ago
Edited 5 years ago

I am attempting to sort a table from smallest to largest numbers using table.sort() but I am a little confused as to how table.sort works. The second argument in table.sort confuses me and there isnt any wiki info on it.

Can anyone help me out? Thank you. :)

0
table.sort(tab, function(a, b) return a < b end) User#19524 175 — 5y
0
Can you explain what the second argument is, I know its a function but like how does that work? GottaHaveAFunTime 218 — 5y
0
Like what would I put in place of a and b and stuff. GottaHaveAFunTime 218 — 5y

Answer this question