酷代码 AI
菜单
服务商

补全代码,对数组进行排序。 var arr = new array(); arr[0] = "george"; arr[1] = "john"; arr[2] = "thomas"; arr[3] = "james"; arr[4] = "adrew"; arr[5] = "martin";__1__

var arr = new Array(); arr[0] = "george"; arr[1] = "john"; arr[2] = "thomas"; arr[3] = "james"; arr[4] = "adrew"; arr[5] = "martin"; arr.sort(); // sort the array in ascending order console.log(arr); // output: ["adrew", "george", "james", "john", "martin", "thomas"]

相关提问
发财导航,免费问AI
实用工具查看更多