반응형 sort3 [javascript] 가장 큰수 2개 찾기, sort(), Math.max(), splice(), indexOf() sort() 메서드는 배열의 요소를 적절한 위치에 정렬한 후 그 배열을 반환합니다. 정렬은 stable sort 가 아닐 수 있습니다. 기본 정렬 순서는 문자열의 유니코드 코드 포인트를 따릅니다. const months = ['March', 'Jan', 'Feb', 'Dec']; months.sort(); console.log(months); // Expected output: Array ["Dec", "Feb", "Jan", "March"] const array1 = [1, 30, 4, 21, 100000]; array1.sort(); console.log(array1); // Expected output: Array [1, 100000, 21, 30, 4] Math.max() 함수는 입력값으로 받은 .. 2023. 9. 12. [javascript] 오름차순 정렬 sort() sort() function solution(n) { n.sort((a, b) => { return a - b; }); return n; } const n = [23, 4, 39, 44, 9, 25]; console.log('solution', solution(n)); 결과 2023. 7. 29. [vuejs] 게시물 or 데이터 정렬버튼 만들기 1. 가지고 오는 데이터의 형태 확인 export default [{ id : 0, title: "Sinrim station 30 meters away", image: "https://codingapple1.github.io/vue/room0.jpg", content: "18년 신축공사한 남향 원룸 ☀️, 공기청정기 제공", price: 340000, fakeReport: 0 }, { id : 1, title: "Changdong Aurora Bedroom(Queen-size)", image: "https://codingapple1.github.io/vue/room1.jpg", content: "침실만 따로 있는 공용 셰어하우스입니다. 최대 2인 가능", price: 450000, fakeReport: .. 2023. 1. 13. 이전 1 다음 반응형