cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Array.sort()

Array.sort()

New Flexscript Arrays are nice, and they conveniently mimic many of the ECMAScript Array methods. One of the most important omissions is a .sort() method. It appears that the only ways to sort something in Flexscript are using a Table.sort() or implementing some sorting algorithm by hand.

I'd like to see .sort() method added to Array, with an optional function-like argument to override the comparison function. Something along the lines of

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort

3 Comments
sastanin
Collaborator

As of FlexSim version 2018.0, Array.sort() is still not implemented.

In the meantime I would use a table query over the array and return the evaluation back to an array by the clause ARRAY_AGG(..).

sastanin
Collaborator

Any chance to get Array.sort() in 2021?

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea