user
Write a code that matches the following output.

Input: Input: [5,9,2,7]
Output: [2,5,7,9]

Output:
assistant
let arr = [5,9,2,7];
arr.sort(function(a,b){return a-b});
console.log(arr); // Output: [2,5,7,9]