320x100
320x100
기본 문법
str.endsWith(searchString[, length])
- searchString
: 끝나는지 찾을 문자열
- length
: 찾고자 하는 문자열의 길이 값
: 기본 값으로는 문자열 전체 길이
- 반환 값
: 문자열의 끝이 주어진 문자열로 끝나면 true / false
var str = 'To be, or not to be, that is the question.';
console.log(str.endsWith('question.')); // true
console.log(str.endsWith('to be')); // false
console.log(str.endsWith('to be', 19)); // true
Refference
300x250
728x90
'Programming > JavaScript' 카테고리의 다른 글
나쁜 자바스크립트 작성 습관과 작별하기 (0) | 2022.12.27 |
---|---|
자바스크립트 TDZ (Temporal-Dead-Zone) / ReferenceError: Cannot access 'white' before initialization (0) | 2022.08.01 |
자바스크립트 프로처럼 쓰는 팁 (0) | 2022.04.30 |
자바스크립트 숨겨진 기능 Shadow DOM 활용법 (0) | 2022.04.24 |
모던 자바스크립트 (문서) 18-6. 속성과 프로퍼티 (0) | 2022.04.24 |