Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2017년 4월.
padStart() 메서드는 String 값의 메서드로, 결과 문자열이 주어진 길이에 도달할 때까지 이 문자열의 시작 부분에 다른 문자열을 (필요하다면 여러 번) 채웁니다. 패딩은 이 문자열의 시작 부분부터 적용됩니다.
현재 str이 패딩된 후의 결과 문자열의 길이입니다. 만약 이 값이 str.length보다 작거나 같다면, str이 그대로 반환됩니다.
padString Optional현재 str을 채우는 데 사용할 문자열입니다. 만약 padString이 targetLength 대비 너무 길다면, 끝 부분이 잘립니다. 기본값은 유니코드 "space" 문자 (U+0020)입니다.
지정된 targetLength의 String으로, padString이 시작 부분부터 적용됩니다.
| ECMAScript® 2027 Language Specification # sec-string.prototype.padstart |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 2월 11일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.