iT邦幫忙

0

ts array & array map _ sort distinct

_Array=['1','2','5','1'];
Array.from(new Set(_Array)).sort();

_Array2=[{id:'1',name:'barry'},{id:'3',name:'collin'},{id:'1',name:'allen'}];
Array.from(new Set(_Array2.map(item => item.id))).sort();


尚未有邦友留言

立即登入留言