In this article
Arrays can be sorted with the sort method. This method takes an optional function name as parameter, a function that defines how to sort elements if they are not to be sorted conventionally.
A script node is wrapped inside a class, so when you refer to the sort function you must use the keyword this to refer to the current instance.
array.sort ({this.sortFunction})