Jump to content

Sort an integer array: Difference between revisions

jq
(jq)
Line 565:
#array // 20, 6, 5, 4, 3, 2, 1</lang>
 
=={{header|Juliajq}}==
jq's builtin <code>sort</code> filter sorts the elements of an array in ascending order:
<lang jq>[2,1,3] | sort # => [1,2,3]</lang>
 
=={{header|Julia}}==
Julia has both out-of-place (<code>sort</code>) and in-place (<code>sort!</code>) sorting functions in its standard-library:
2,497

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.