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. :)

4 comments
table.sort(tab, function(a, b) return a < b end)
Can you explain what the second argument is, I know its a function but like how does that work?
Like what would I put in place of a and b and stuff.
https://www.lua.org/pil/19.3.html