{
"id": "fn-array-sort",
"dataComponent": "array",
"heading": {
"title": "sort",
"badges": ["Array"]
},
"synopsis": "Sorts an array in ascending order (numeric or string).",
"codeBlocks": [
"extend(\"array\")\n\nnums = [3,1,2]\nsput(array:sort(nums))\n// => [1,2,3]\n\nwords = [\"b\", \"c\", \"a\"]\nsput(array:sort(words))\n// => [\"a\", \"b\", \"c\"]"
],
"notes": [
"Sorts a copy, original is unchanged.",
"Supports int[], float[], str[] and MixedArray with sortable elements."
]
}