const actio = { 1:['nv','n'], 2:['nam','m'], default:['t','t'] } function on(type){ const a = actio[type] console.log('on(1)',a) } on(1) let arr = [12,45,97,9797,564,134,45642] console.log(arr) let set = new Set(arr) let a = Array.from(set, item => { console.log(item) return item+1 }) console.log('122',a) // [ 13, 46, 98, 9798, 565, 135, 45643 ]