{
"id": "fn-array-sortBy",
"dataComponent": "array",
"heading": {
"title": "sortBy",
"badges": ["Array", "PARTIAL"]
},
"synopsis": "Sorts an array by the result of mapping each item through a function.",
"codeBlocks": [
"extend(\"array\")\n\npeople = [ [name:\"Alice\", age:30], [name:\"Bob\", age:25] ]\nsput(array:sortBy(obj => array:prop(\"age\", obj), people))\n// => [ [name:\"Bob\",...], [name:\"Alice\",...] ]"
],
"notes": [
"Takes (function, array). Function called for each item to extract sort value.",
"Returns sorted copy. Partial usage supported."
]
}