String - ES6 string 에 새로운 메서드들

Yuri Lee·2020년 7월 2일
0

javascript

목록 보기
3/4

이 글은 인프런의 '모던 자바스크립트 개발을 위한 ES6 강좌'의 수강 내용을 바탕으로 정리한 내용입니다.

  • String.startsWith(""): 임의의 문자열로 시작하는지 판단함
  • String.endsWith(""): 임의의 문자열로 끝나는지 판단함
  • String.includes(""): 임의의 문자열이 들어있는지 판단함
let str = "hello world! ^^";
let matchstr = "hello";
console.log(str.startsWith(matchstr));
console.log(str.endsWith(matchstr));
profile
Step by step goes a long way ✨

0개의 댓글