diff options
Diffstat (limited to 'files/nl/web/javascript/reference/global_objects/object/index.html')
-rw-r--r-- | files/nl/web/javascript/reference/global_objects/object/index.html | 226 |
1 files changed, 0 insertions, 226 deletions
diff --git a/files/nl/web/javascript/reference/global_objects/object/index.html b/files/nl/web/javascript/reference/global_objects/object/index.html deleted file mode 100644 index 52aaef2901..0000000000 --- a/files/nl/web/javascript/reference/global_objects/object/index.html +++ /dev/null @@ -1,226 +0,0 @@ ---- -title: Object -slug: Web/JavaScript/Reference/Global_Objects/Object -tags: - - Constructor - - JavaScript - - NeedsTranslation - - Object - - TopicStub -translation_of: Web/JavaScript/Reference/Global_Objects/Object ---- -<div>{{JSRef}}</div> - -<p>The <code><strong>Object</strong></code> constructor creates an object wrapper.</p> - -<h2 id="Syntax">Syntax</h2> - -<pre class="syntaxbox"><code>// Object initialiser or literal -{ [ <var>nameValuePair1</var>[, <var>nameValuePair2</var>[, ...<var>nameValuePairN</var>] ] ] } - -// Called as a constructor -new Object([<var>value</var>])</code></pre> - -<h3 id="Parameters">Parameters</h3> - -<dl> - <dt><code>nameValuePair1, nameValuePair2, ... nameValuePair<em>N</em></code></dt> - <dd>Pairs of names (strings) and values (any value) where the name is separated from the value by a colon.</dd> - <dt><code>value</code></dt> - <dd>Any value.</dd> -</dl> - -<h2 id="Description">Description</h2> - -<p>The <code>Object</code> constructor creates an object wrapper for the given value. If the value is {{jsxref("null")}} or {{jsxref("undefined")}}, it will create and return an empty object, otherwise, it will return an object of a Type that corresponds to the given value. If the value is an object already, it will return the value.</p> - -<p>When called in a non-constructor context, <code>Object</code> behaves identically to <code>new Object()</code>.</p> - -<p>See also the <a href="/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer">object initializer / literal syntax</a>.</p> - -<h2 id="Properties_of_the_Object_constructor">Properties of the <code>Object</code> constructor</h2> - -<dl> - <dt><code>Object.length</code></dt> - <dd>Has a value of 1.</dd> - <dt>{{jsxref("Object.prototype")}}</dt> - <dd>Allows the addition of properties to all objects of type Object.</dd> -</dl> - -<h2 id="Methods_of_the_Object_constructor">Methods of the <code>Object</code> constructor</h2> - -<dl> - <dt>{{jsxref("Object.assign()")}}</dt> - <dd>Creates a new object by copying the values of all enumerable own properties from one or more source objects to a target object.</dd> - <dt>{{jsxref("Object.create()")}}</dt> - <dd>Creates a new object with the specified prototype object and properties.</dd> - <dt>{{jsxref("Object.defineProperty()")}}</dt> - <dd>Adds the named property described by a given descriptor to an object.</dd> - <dt>{{jsxref("Object.defineProperties()")}}</dt> - <dd>Adds the named properties described by the given descriptors to an object.</dd> - <dt>{{jsxref("Object.entries()")}} {{experimental_inline}}</dt> - <dd>Returns an array of a given object's own enumerable property <code>[key, value]</code> pairs.</dd> - <dt>{{jsxref("Object.freeze()")}}</dt> - <dd>Freezes an object: other code can't delete or change any properties.</dd> - <dt>{{jsxref("Object.getOwnPropertyDescriptor()")}}</dt> - <dd>Returns a property descriptor for a named property on an object.</dd> - <dt>{{jsxref("Object.getOwnPropertyNames()")}}</dt> - <dd>Returns an array containing the names of all of the given object's <strong>own</strong> enumerable and non-enumerable properties.</dd> - <dt>{{jsxref("Object.getOwnPropertySymbols()")}}</dt> - <dd>Returns an array of all symbol properties found directly upon a given object.</dd> - <dt>{{jsxref("Object.getPrototypeOf()")}}</dt> - <dd>Returns the prototype of the specified object.</dd> - <dt>{{jsxref("Object.is()")}}</dt> - <dd>Compares if two values are distinguishable (ie. the same)</dd> - <dt>{{jsxref("Object.isExtensible()")}}</dt> - <dd>Determines if extending of an object is allowed.</dd> - <dt>{{jsxref("Object.isFrozen()")}}</dt> - <dd>Determines if an object was frozen.</dd> - <dt>{{jsxref("Object.isSealed()")}}</dt> - <dd>Determines if an object is sealed.</dd> - <dt>{{jsxref("Object.keys()")}}</dt> - <dd>Returns an array containing the names of all of the given object's <strong>own</strong> enumerable properties.</dd> - <dt>{{jsxref("Object.observe()")}} {{non-standard_inline}}</dt> - <dd>Asynchronously observes changes to an object.</dd> - <dt>{{jsxref("Object.getNotifier()")}} {{non-standard_inline}}</dt> - <dd>Get a notifier with which to create object changes manually.</dd> - <dt>{{jsxref("Object.preventExtensions()")}}</dt> - <dd>Prevents any extensions of an object.</dd> - <dt>{{jsxref("Object.seal()")}}</dt> - <dd>Prevents other code from deleting properties of an object.</dd> - <dt>{{jsxref("Object.setPrototypeOf()")}}</dt> - <dd>Sets the prototype (i.e., the internal <code>[[Prototype]]</code> property)</dd> - <dt>{{jsxref("Object.unobserve()")}} {{non-standard_inline}}</dt> - <dd>Unobserves changes to an object.</dd> - <dt>{{jsxref("Object.values()")}} {{experimental_inline}}</dt> - <dd>Returns an array of a given object's own enumerable values.</dd> -</dl> - -<h2 id="Object_instances_and_Object_prototype_object"><code>Object</code> instances and <code>Object</code> prototype object</h2> - -<p>All objects in JavaScript are descended from <code>Object</code>; all objects inherit methods and properties from {{jsxref("Object.prototype")}}, although they may be overridden. For example, other constructors' prototypes override the <code>constructor</code> property and provide their own <code>toString()</code> methods. Changes to the <code>Object</code> prototype object are propagated to all objects unless the properties and methods subject to those changes are overridden further along the prototype chain.</p> - -<h3 id="Properties">Properties</h3> - -<div>{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype', 'Properties') }}</div> - -<h3 id="Methods">Methods</h3> - -<div>{{page('/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/prototype', 'Methods') }}</div> - -<h2 id="Examples">Examples</h2> - -<h3 id="Using_Object_given_undefined_and_null_types">Using <code>Object</code> given <code>undefined</code> and <code>null</code> types</h3> - -<p>The following examples store an empty <code>Object</code> object in <code>o</code>:</p> - -<pre class="brush: js">var o = new Object(); -</pre> - -<pre class="brush: js">var o = new Object(undefined); -</pre> - -<pre class="brush: js">var o = new Object(null); -</pre> - -<h3 id="Using_Object_to_create_Boolean_objects">Using <code>Object</code> to create <code>Boolean</code> objects</h3> - -<p>The following examples store {{jsxref("Boolean")}} objects in <code>o</code>:</p> - -<pre class="brush: js">// equivalent to o = new Boolean(true); -var o = new Object(true); -</pre> - -<pre class="brush: js">// equivalent to o = new Boolean(false); -var o = new Object(Boolean()); -</pre> - -<h2 id="Specifications">Specifications</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('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Initial definition. Implemented in JavaScript 1.0.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.2', 'Object')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-object-objects', 'Object')}}</td> - <td>{{Spec2('ES6')}}</td> - <td>Added Object.assign, Object.getOwnPropertySymbols, Object.setPrototypeOf</td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-object-objects', 'Object')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td>Added Object.entries and Object.values.</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - -<div>{{CompatibilityTable}}</div> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Basic support</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Basic support</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="See_also">See also</h2> - -<ul> - <li><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer">Object initializer</a></li> -</ul> |