String.endsWith
str.endsWith(suffix)
특정 문자열로 끝나는지 확인한다.
접미사로 끝나면 true를 반환합니다. 확장자 검사 등에 유용합니다.
반환값boolean
예시
'photo.png'.endsWith('.png'); // true← JavaScript 메서드 사전 전체 보기str.endsWith(suffix)
특정 문자열로 끝나는지 확인한다.
접미사로 끝나면 true를 반환합니다. 확장자 검사 등에 유용합니다.
반환값boolean
예시
'photo.png'.endsWith('.png'); // true← JavaScript 메서드 사전 전체 보기