📜
Ends With
Ends With쉬움 문자열 +10pts
Problem
Write a function that checks if a string ends with a given suffix.
Examples
Input:
endsWith("hello", "lo")Output:
trueExplanation
이 문제는 **endsWith() 메서드**로 문자열의 끝을 확인하는 방법을 학습합니다. ## 핵심 개념: 접미사 확인 endsWith()는 문자열이 특정 문자열로 끝나는지 확인합니다. ### 기본 사용법 ```javascript str.endsWith(searchString) str.endsWith(searchString, length) ``` - searchString: 찾을 접미사 - length: 검색할 문자열 길이 (기본값: str.length) ### 활용 예시 ```javascript "hello".endsWit...
View detailed explanation →Key Concepts
endsWith 메서드 접미사 확인 파일 확장자 검사 ES6 메서드
Time: O(m) Space: O(1)
solution.js
Ctrl + Enter
Run tests to see results here.