startsWith (1) 썸네일형 리스트형 [JS/ES6] 추가된 String의 메서드들 ES6에서 추가된 String의 메서드들 String.startsWith(matchString) matchString이 String의 앞부터 일치하는지 확인 (true/false) String.endsWith(matchString) matchString이 String의 뒤부터 일치하는지 확인 (true/false) String.includes(matchString) matchString이 String에 포함되어 있는지 확인(true/false) 예시let str = "hello world ~!~!"; str.startsWith("hello"); //truestr.endsWith("~!~!"); //true str.startsWith("h ello"); //falsestr.endsWith("~! ~!");.. 이전 1 다음