标签:div length log 选择 let sele return data code
const arr = [21, 2, 5, 3, 1, 2, 6, 3, 3]; function select(data) { var index; for (let i = 0; i < data.length - 1; i++) { index = i; for (let m = i; m < data.length; m++) { if (data[index] > data[m]) { index = m; } } let tmp = data[index]; data[index] = data[i]; data[i] = tmp; } return data; } console.log(select(arr));
标签:div length log 选择 let sele return data code
原文地址:https://www.cnblogs.com/jiajiaobj/p/13654940.html