mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-02-26 17:11:20 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
<div></div>
|
||||
<p>静态方法 <code><strong>Reflect</strong></code><strong><code>.set()</code></strong> 工作方式就像在一个对象上设置一个属性。</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox">Reflect.set(target, propertyKey, value[, receiver])
|
||||
</pre>
|
||||
<pre><code class="language-javascript">Reflect.set(target, propertyKey, value[, receiver])
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>target</code></dt>
|
||||
@@ -23,7 +23,7 @@
|
||||
<p><code>Reflect.set</code> 方法允许你在对象上设置属性。它的作用是给属性赋值并且就像 <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors">property accessor</a> 语法一样,但是它是以函数的方式。 </p>
|
||||
<h2 id="示例">示例</h2>
|
||||
<h3 id="使用_Reflect.set()">使用 <code>Reflect.set()</code></h3>
|
||||
<pre class="brush: js">// Object
|
||||
<pre><code class="language-javascript">// Object
|
||||
var obj = {};
|
||||
Reflect.set(obj, "prop", "value"); // true
|
||||
obj.prop; // "value"
|
||||
@@ -42,7 +42,7 @@ var obj = {};
|
||||
Reflect.set(obj); // true
|
||||
Reflect.getOwnPropertyDescriptor(obj, "undefined");
|
||||
// { value: undefined, writable: true, enumerable: true, configurable: true }
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user