반응형

data.sort((a, b) => a.price - b.price || a.name.localeCompare(b.name)); // 가격이 낮은 순으로 정렬하고, 가격이 같으면 이름순으로 정렬

반응형

+ Recent posts