const input = [2, 3, 3, 5, 2, 1, 4, 7, 9];
function deWeight(str) {
//1.set去重,用扩展运算符转为数组(没转换前是对象)
// const input2 = [...new Set(input)];
//2.arry函数讲set集合转为数组
const input2 = Array.from(new Set(input));
console.log(input2);
//数组排序
function sort1(a, b) {
return a - b;
}
input2.sort(sort1);
console.log(input2);
}
deWeight(input);