Complete the function
// returns nums sorted in ascending numeric order
function sortAsc(nums: number[]): number[] {
return [...nums].sort((a, b) => ____);
}
// sortAsc([3,1,2]) -> [1,2,3]
Answer: a - b
a - b sorts numbers in ascending order.
Play Problem Solving ▸