- 모질라 : https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
str.startsWith(searchString[, position])
startsWith() 메소드는 어떤 문자열이 특정 문자로 시작하는지 확인하여 결과를 true 혹은 false로 반환합니다.
인자
searchString
문자열의 시작 지점에서 탐색할 문자열
position
OptionalsearchString
을 탐색할 위치. 기본값 0.//startswith var str = 'To be, or not to be, that is the question.'; console.log(str.startsWith('To be')); // true console.log(str.startsWith('not to be')); // false console.log(str.startsWith('not to be', 10)); // true // 10번째 인덱스에서부터 검사