Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- map()
- 배열과 연결리스트의 차이
- 객체
- display : none
- 단방향 연결리스트
- 일반 형제 선택자 결합
- filter()
- 배열의 오름차순
- 범용 선택자
- for..of
- 인접 형제 선택자 결합
- Sort
- CSS
- invalid assignment left-hand side
- 쌍방향 연결리스트
- indexOf
- innerhtml
- 고차함수
- 등차수열의 항 찾기
- Em
- disabled
- 배열의 내림차순
- Link
- Array.from()
- 양방향 연결리스트
- nth-child()
- 백준알고리즘
- 가상 요소 선택자
- visibility : hidden
- classList.contains(string)
Archives
- Today
- Total
목록localCompare (1)
프론트엔드 센트럴파크 (☞゚ヮ゚)☞

배열에 대문자와 소문자가 섞여 있는 경우, toUpperCase() 함수를 이용해 대문자로 다 바꾼 후 콜백함수를 사용하여 문자 크기를 비교한다. 오름차순 let ascending_order = function(x,y) { x = x.toUpperCase(); y = y.toUpperCase(); if (x > y) return 1; else if (y > x) return -1; else return 0; }; let fruits = ["apple", "Orange", "orange", "melon"]; console.log(fruits.sort(ascending_order)); 내림차순 let descending_order = function(x,y) { x = x.toUpperCase(); y = ..
Javascript
2022. 5. 26. 13:36