When I run a loop, it returns a combination of integer values and objects as shown below:
2
{firstName:"John", lastName:"Doe", age:28, eyeColor:"blue"}
3
{firstName:"Jane", lastName:"Doe", age:22, eyeColor:"brown"}
1
{firstName:"Jack", lastName:"Doe", age:50, eyeColor:"red"}
These are unique values that the loop generates line by line. My goal is to iterate over the objects based on the numerical order and store each number and object in separate variables. The desired output is:
1
{firstName:"Jack", lastName:"Doe", age:50, eyeColor:"red"}
2
{firstName:"John", lastName:"Doe", age:28, eyeColor:"blue"}
3
{firstName:"Jane", lastName:"Doe", age:22, eyeColor:"brown"}
This structured data will enable me to effectively utilize a function like this:
loop sorted
some_function(number_variable, object_variable);
end loop
The specific order in which these values are called is vital for grid column reordering purposes.
I have attempted storing the objects in an array, but I am unsure how to sort them based on the accompanying number values.
Appreciate any assistance you can provide!