From da78a9e329e272dedb2400b79a3bdeebff387d47 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:17 -0500 Subject: initial commit --- .../global_objects/string/touppercase/index.html | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 files/ko/web/javascript/reference/global_objects/string/touppercase/index.html (limited to 'files/ko/web/javascript/reference/global_objects/string/touppercase') diff --git a/files/ko/web/javascript/reference/global_objects/string/touppercase/index.html b/files/ko/web/javascript/reference/global_objects/string/touppercase/index.html new file mode 100644 index 0000000000..f6a0c8f05c --- /dev/null +++ b/files/ko/web/javascript/reference/global_objects/string/touppercase/index.html @@ -0,0 +1,105 @@ +--- +title: String.prototype.toUpperCase() +slug: Web/JavaScript/Reference/Global_Objects/String/toUpperCase +tags: + - JavaScript + - Method + - Prototype + - Reference + - String +translation_of: Web/JavaScript/Reference/Global_Objects/String/toUpperCase +--- +
{{JSRef}}
+ +

toUpperCase() 메서드는 문자열을 대문자로 변환해 반환합니다.

+ +
{{EmbedInteractiveExample("pages/js/string-touppercase.html")}}
+ + + +

구문

+ +
str.toUpperCase()
+ +

반환 값

+ +

대문자로 변환한 새로운 문자열.

+ +

예외

+ +
+
{{jsxref("TypeError")}}
+
{{jsxref("Function.prototype.call()")}} 등을 사용해 {{jsxref("null")}}이나 {{jsxref("undefined")}}에서 호출 시.
+
+ +

설명

+ +

toUpperCase() 메서드는 문자열을 대문자로 변환한 값을 반환합니다. JavaScript의 문자열은 불변하므로 원본 문자열에는 영향을 주지 않습니다.

+ +

예제

+ +

기본 사용법

+ +
console.log('alphabet'.toUpperCase()); // 'ALPHABET'
+ +

문자열이 아닌 this의 문자열 변환

+ +

toUpperCase()this가 문자열이 아니고, undefinednull도 아니면 자동으로 문자열로 변환합니다.

+ +
const a = String.prototype.toUpperCase.call({
+  toString: function toString() {
+    return 'abcdef';
+  }
+});
+
+const b = String.prototype.toUpperCase.call(true);
+
+// prints out 'ABCDEF TRUE'.
+console.log(a, b);
+
+ +

명세

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
명세상태비고
{{SpecName('ES1')}}{{Spec2('ES1')}}Initial definition. Implemented in JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.5.4.18', 'String.prototype.toUpperCase')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-string.prototype.touppercase', 'String.prototype.toUpperCase')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-string.prototype.touppercase', 'String.prototype.toUpperCase')}}{{Spec2('ESDraft')}} 
+ +

브라우저 호환성

+ + + +

{{Compat("javascript.builtins.String.toUpperCase")}}

+ +

같이 보기

+ + -- cgit v1.2.3-54-g00ecf