function
boot.janet on line 973 , column 1
(sorted ind &opt before? )
Returns a new sorted array without modifying the old one. If a
`before?` comparator function is provided , sorts elements using
that , otherwise uses `<` .
# sorted allocates the full memory of its input
(def d2 (range 10000000 0 -1 )) # 87mb
(sorted d2 ) # now 167 mb
# with by function
(sorted [1 -2 2 3 9 -10 ] ) #@[9 3 2 1 -2 -10]
(sorted [1 -2 2 3 9 -10 ]) # @[-10 -2 1 2 3 9]