티스토리 뷰

Javascript

[ES6] New string method

yemsu 2020. 3. 26. 10:53

.startsWith()

String.prototype.startsWith(searchString, position = 0)

Returns true if the receiver starts with searchString; the position lets you specify where the string to be checked starts.

 

.endsWith()

String.prototype.endsWith(searchString, endPosition = searchString.length)

Returns true if the receiver starts with searchString; the position lets you specify where the string to be checked starts.

 

.includes()

String.prototype.includes(searchString, position = 0)

Returns true if the receiver contains searchString; position lets you specify where the string to be searched starts.

 

.repeat()

String.prototype.repeat(count)

Returns the receiver, concatenated count times.

 

 

참고

https://www.inflearn.com/course/es6-%EA%B0%95%EC%A2%8C-%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8/lecture/6980)

https://exploringjs.com/es6/ch_strings.html

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2026/01   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함