로딩
요청 처리 중입니다...

[javaScript] .startsWith() 및 .endsWith() 메서드

 [javaScript] .startsWith() 및 .endsWith() 메서드

** .startsWith() 메서드 문자열이 특정 문자열로 시작하는지 확인 문자열이 지정된 문자열로 시작하면 true, 그렇지 않으면 false를 반환한다. //예시 let message = "Hello, World!"

; console.log(message.startsWith("Hello")); //true console.log(message.startsWith("World", 7)); //true(검사 시작 위치를 7로 시작한다.) console.log(message.startsWith("Goodbye")); //false ** .endswith() 메서드 문자열이 특정 문자열로 끝나는지 확인 문자열이 지정된 문자열로 끝나면 true, 그렇지 않으면 false를 반환 //예시 let fileName = "example.jpg"; console.log(fileName.endsWith(".jpg")); //true console.lo...

# endsWith # 시작 # 문자열 # 메서드 # 끝 # true # string # startsWith # includes # if # false # 코딩연습