JavaScript 문자열 startsWith()

1 개요[ | ]

JavaScript startsWith()
자바스크립트 startsWith()
var str = "Hello world!";
console.log( str.startsWith("Hello") ); // true
console.log( str.startsWith("He") ); // true
console.log( str.startsWith("ll") ); // false
console.log( str.startsWith("ll", 2) ); // true
const str1 = 'Saturday night plans';
console.log(str1.startsWith('Sat')); // true
console.log(str1.startsWith('Sat', 3)); // false
const 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

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}