diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:42:17 -0500 |
commit | da78a9e329e272dedb2400b79a3bdeebff387d47 (patch) | |
tree | e6ef8aa7c43556f55ddfe031a01cf0a8fa271bfe /files/ko/web/javascript/reference/global_objects/reflect/deleteproperty/index.html | |
parent | 1109132f09d75da9a28b649c7677bb6ce07c40c0 (diff) | |
download | translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.gz translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.tar.bz2 translated-content-da78a9e329e272dedb2400b79a3bdeebff387d47.zip |
initial commit
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/reflect/deleteproperty/index.html')
-rw-r--r-- | files/ko/web/javascript/reference/global_objects/reflect/deleteproperty/index.html | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/reflect/deleteproperty/index.html b/files/ko/web/javascript/reference/global_objects/reflect/deleteproperty/index.html new file mode 100644 index 0000000000..de3b8f8ed8 --- /dev/null +++ b/files/ko/web/javascript/reference/global_objects/reflect/deleteproperty/index.html @@ -0,0 +1,98 @@ +--- +title: Reflect.deleteProperty() +slug: Web/JavaScript/Reference/Global_Objects/Reflect/deleteProperty +tags: + - ECMAScript 2015 + - JavaScript + - Method + - Reference + - Reflect +translation_of: Web/JavaScript/Reference/Global_Objects/Reflect/deleteProperty +--- +<div>{{JSRef}}</div> + +<p><code><strong>Reflect</strong></code><strong><code>.deleteProperty()</code></strong> 정적 메서드는 속성을 제거할 수 있습니다. <a href="/ko/docs/Web/JavaScript/Reference/Operators/delete"><code>delete</code> 연산자</a>의 함수판이라고 할 수 있습니다.</p> + +<div>{{EmbedInteractiveExample("pages/js/reflect-deleteproperty.html", "taller")}}</div> + + + +<h2 id="구문">구문</h2> + +<pre class="syntaxbox">Reflect.deleteProperty(<em>target</em>, <em>propertyKey</em>) +</pre> + +<h3 id="매개변수">매개변수</h3> + +<dl> + <dt><code>target</code></dt> + <dd>속성을 제거할 대상 객체.</dd> + <dt><code>propertyKey</code></dt> + <dd>제거할 속성의 이름.</dd> +</dl> + +<h3 id="반환_값">반환 값</h3> + +<p>속성이 성공적으로 제거됐는지 나타내는 {{jsxref("Boolean")}}.</p> + +<h3 id="Exceptions">Exceptions</h3> + +<p><code>target</code>이 {{jsxref("Object")}}가 아니면 {{jsxref("TypeError")}}.</p> + +<h2 id="설명">설명</h2> + +<p><code>Reflect.deleteProperty</code> 메서드는 객체의 속성을 제거할 수 있습니다. 반환값은 속성의 제거 성공 여부를 나타내는 {{jsxref("Boolean")}}입니다. 비엄격 모드의 <a href="/ko/docs/Web/JavaScript/Reference/Operators/delete"><code>delete</code> 연산자</a>와 거의 동일합니다.</p> + +<h2 id="예제">예제</h2> + +<h3 id="Reflect.deleteProperty()_사용하기"><code>Reflect.deleteProperty()</code> 사용하기</h3> + +<pre class="brush: js">var obj = { x: 1, y: 2 }; +Reflect.deleteProperty(obj, 'x'); // true +obj; // { y: 2 } + +var arr = [1, 2, 3, 4, 5]; +Reflect.deleteProperty(arr, '3'); // true +arr; // [1, 2, 3, , 5] + +// 주어진 속성이 존재하지 않으면 true 반환 +Reflect.deleteProperty({}, 'foo'); // true + +// 주어진 속성이 설정 불가능하면 false 반환 +Reflect.deleteProperty(Object.freeze({foo: 1}), 'foo'); // false +</pre> + +<h2 id="명세">명세</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + <tr> + <td>{{SpecName('ES2015', '#sec-reflect.deleteproperty', 'Reflect.deleteProperty')}}</td> + <td>{{Spec2('ES2015')}}</td> + <td>Initial definition.</td> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-reflect.deleteproperty', 'Reflect.deleteProperty')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="브라우저_호환성">브라우저 호환성</h2> + + + +<p>{{Compat("javascript.builtins.Reflect.deleteProperty")}}</p> + +<h2 id="같이_보기">같이 보기</h2> + +<ul> + <li>{{jsxref("Reflect")}}</li> + <li><a href="/ko/docs/Web/JavaScript/Reference/Operators/delete"><code>delete</code> 연산자</a></li> +</ul> |