i'm trying to use table.sort() but it's not seeming to work out for me.
Any idea what i'm doing wrong?
local list = {1,66,45,76542,3,7,324,56,8,98,46,73757,34,12,5,1,2,3,4,6,7,9,33,55,67,14} local sorted = table.sort(list) print(sorted)
Output:
nil
I would just delete the entire question because I figured it out and it was super simple... and I figure if I had this problem maybe someone else will or has as well.. So Here is the solution
table.sort() NEVER RETURNS ANYTHING so....
local list = {1,64,3,6,865,80,6,245,8,3456,997,97,0,75,3} local a = table.sort(list) print(a)
a will ALWAYS = nil a will NEVER not = nil
Therefore... SOLUTION
local list = {1,64,3,6,865,80,6,245,8,3456,997,97,0,75,3} table.sort(list) print(table.concat(list, "|"))
Conclusion: table.sort() sorts that list given. It does NOT create a new 'sorted' list.
I'm aware I should have known this. But I overlooked things. Hope my issue helps someone lol