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 2015년 7월.
String() 생성자는 String 객체를 생성합니다. 함수로 호출될 경우 String 형의 원시 값을 반환합니다.
문자로 바꿀 모든 것.
String()이 함수로 호출되면 (new 없이) 문자열 원시형으로 강제로 변환된 값을 반환합니다. 특히 Symbol 값은 "Symbol(description)"으로 변환되며, 여기서 description은 심볼의 description입니다.
String()이 생성자로 호출되면(new와 함께) 특별한 기호 심볼처리 없이 value을 문자열 원시형으로 강제로 변환하고 원시형이 아닌 String 객체로 감싸서 반환합니다.
경고 : String 생성자를 사용하는 경우는 거의 없습니다.
String 함수와 String 생성자는 다른 결과를 생성합니다.
여기서 함수는 약속한 대로 문자열(원시 값 유형)을 생성합니다. 그러나 생성자는 문자열(객체 래퍼) 유형의 인스턴스를 생성하므로 문자열 생성자를 사용하는 경우는 거의 없습니다.
String()은 심볼을 어떠한 에러 발생 없이 변환을 할 수 있는 유일한 방법입니다. 매우 명시적이기 때문이지요.
| ECMAScript® 2027 Language Specification # sec-string-constructor |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025년 10월 9일 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.