Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 맛사지
- 자동완성
- 마사지
- 유효성검사
- 스쿠버다이빙
- js
- autocomplate
- JavaScript
- ES6
- 삼성무선청소기제트
- 해외여행
- Hooks
- Webpack
- 세부
- 정직하게사세요
- 막탄
- 사기
- 구분
- webpack.config.js
- 여행
- 중고나라
- 네이버페이사기
- 중고거래사기
- 정규식
- REACT
- 특수문자
- plugin
- 스노쿨링
- 중고나라사기
Archives
- Today
- Total
Ryu.log
string.localeCompare() 본문
string.localeCompare()
string.localecompare() 메서드는 기준 문자열과 비교했을 때 비교 대상 문자열이 정렬상 전에 오는지,
후에 오는지 혹은 같은 순서에 배치되는지를 알려주는 숫자를 리턴해준다.
str.localeCompare(비교str) //stre : 대상 문자 //비교str : 비교할 문자
예제 코드
console.log('a'.localeCompare('b')); // -1 console.log('b'.localeCompare('a')); // 1 console.log('b'.localeCompare('b')); // 0
'Prev-content' 카테고리의 다른 글
Array.prototype.pop() (0) | 2018.11.13 |
---|---|
Array.prototype.sort() (0) | 2018.11.12 |
String.prototype.repeat() (0) | 2018.11.09 |
Array.from() (0) | 2018.11.05 |
[ Redux 유용 ] 리액트 App에 손쉽게 store를 연결시켜주는 Provider 컴포넌트 (0) | 2018.09.20 |
Comments