酷代码 AI
菜单
全部AI  /  热门  /  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"]

相关提问