aboutsummaryrefslogtreecommitdiff
path: root/files/tr/web/javascript/reference/global_objects/array
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 14:51:31 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 14:51:31 +0100
commit8f2731905212f6e7eb2d9793ad20b8b448c54ccf (patch)
tree68b111146b149114ea5913c4ad6d1dfad9e839e3 /files/tr/web/javascript/reference/global_objects/array
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-8f2731905212f6e7eb2d9793ad20b8b448c54ccf.tar.gz
translated-content-8f2731905212f6e7eb2d9793ad20b8b448c54ccf.tar.bz2
translated-content-8f2731905212f6e7eb2d9793ad20b8b448c54ccf.zip
unslug tr: move
Diffstat (limited to 'files/tr/web/javascript/reference/global_objects/array')
-rw-r--r--files/tr/web/javascript/reference/global_objects/array/prototype/index.html205
1 files changed, 0 insertions, 205 deletions
diff --git a/files/tr/web/javascript/reference/global_objects/array/prototype/index.html b/files/tr/web/javascript/reference/global_objects/array/prototype/index.html
deleted file mode 100644
index 19ffe3c80f..0000000000
--- a/files/tr/web/javascript/reference/global_objects/array/prototype/index.html
+++ /dev/null
@@ -1,205 +0,0 @@
----
-title: Array.prototype
-slug: Web/JavaScript/Reference/Global_Objects/Array/prototype
-translation_of: Web/JavaScript/Reference/Global_Objects/Array/prototype
----
-<div>{{JSRef("Global_Objects", "Array")}}</div>
-
-<h2 id="Summary" name="Summary">Summary</h2>
-
-<p>The <strong><code>Array.prototype</code></strong> property represents the prototype for the {{jsxref("Global_Objects/Array", "Array")}} constructor.</p>
-
-<div>{{js_property_attributes(0, 0, 0)}}</div>
-
-<h2 id="Description" name="Description">Description</h2>
-
-<p>{{jsxref("Global_Objects/Array", "Array")}} instances inherit from <code>Array.prototype</code>. As with all constructors, you can change the constructor's prototype object to make changes to all {{jsxref("Global_Objects/Array", "Array")}} instances.</p>
-
-<p>Little known fact: <code>Array.prototype</code> itself is an {{jsxref("Global_Objects/Array", "Array")}}:</p>
-
-<pre class="brush: js">Array.isArray(Array.prototype); // true
-</pre>
-
-<h2 id="Properties" name="Properties">Properties</h2>
-
-<dl>
- <dt><code>Array.prototype.constructor</code></dt>
- <dd>Specifies the function that creates an object's prototype.</dd>
- <dt>{{jsxref("Array.prototype.length")}}</dt>
- <dd>Reflects the number of elements in an array.</dd>
-</dl>
-
-<h2 id="Methods" name="Methods">Methods</h2>
-
-<h3 id="Mutator_methods" name="Mutator_methods">Mutator methods</h3>
-
-<p>These methods modify the array:</p>
-
-<dl>
- <dt>{{jsxref("Array.prototype.copyWithin()")}} {{experimental_inline}}</dt>
- <dd>Copies a sequence of array elements within the array.</dd>
- <dt>{{jsxref("Array.prototype.fill()")}} {{experimental_inline}}</dt>
- <dd>Fills all the elements of an array from a start index to an end index with a static value.</dd>
- <dt>{{jsxref("Array.prototype.pop()")}}</dt>
- <dd>Removes the last element from an array and returns that element.</dd>
- <dt>{{jsxref("Array.prototype.push()")}}</dt>
- <dd>Adds one or more elements to the end of an array and returns the new length of the array.</dd>
- <dt>{{jsxref("Array.prototype.reverse()")}}</dt>
- <dd>Reverses the order of the elements of an array in place — the first becomes the last, and the last becomes the first.</dd>
- <dt>{{jsxref("Array.prototype.shift()")}}</dt>
- <dd>Removes the first element from an array and returns that element.</dd>
- <dt>{{jsxref("Array.prototype.sort()")}}</dt>
- <dd>Sorts the elements of an array in place and returns the array.</dd>
- <dt>{{jsxref("Array.prototype.splice()")}}</dt>
- <dd>Adds and/or removes elements from an array.</dd>
- <dt>{{jsxref("Array.prototype.unshift()")}}</dt>
- <dd>Adds one or more elements to the front of an array and returns the new length of the array.</dd>
-</dl>
-
-<h3 id="Accessor_methods" name="Accessor_methods">Accessor methods</h3>
-
-<p>These methods do not modify the array and return some representation of the array.</p>
-
-<dl>
- <dt>{{jsxref("Array.prototype.concat()")}}</dt>
- <dd>Returns a new array comprised of this array joined with other array(s) and/or value(s).</dd>
- <dt>{{jsxref("Array.prototype.includes()")}} {{experimental_inline}}</dt>
- <dd>Determines whether an array contains a certain element, returning <code>true</code> or <code>false</code> as appropriate.</dd>
- <dt>{{jsxref("Array.prototype.join()")}}</dt>
- <dd>Joins all elements of an array into a string.</dd>
- <dt>{{jsxref("Array.prototype.slice()")}}</dt>
- <dd>Extracts a section of an array and returns a new array.</dd>
- <dt>{{jsxref("Array.prototype.toSource()")}} {{non-standard_inline}}</dt>
- <dd>Returns an array literal representing the specified array; you can use this value to create a new array. Overrides the {{jsxref("Object.prototype.toSource()")}} method.</dd>
- <dt>{{jsxref("Array.prototype.toString()")}}</dt>
- <dd>Returns a string representing the array and its elements. Overrides the {{jsxref("Object.prototype.toString()")}} method.</dd>
- <dt>{{jsxref("Array.prototype.toLocaleString()")}}</dt>
- <dd>Returns a localized string representing the array and its elements. Overrides the {{jsxref("Object.prototype.toLocaleString()")}} method.</dd>
- <dt>{{jsxref("Array.prototype.indexOf()")}}</dt>
- <dd>Returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found.</dd>
- <dt>{{jsxref("Array.prototype.lastIndexOf()")}}</dt>
- <dd>Returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found.</dd>
-</dl>
-
-<h3 id="Iteration_methods" name="Iteration_methods">Iteration methods</h3>
-
-<p>Several methods take as arguments functions to be called back while processing the array. When these methods are called, the <code>length</code> of the array is sampled, and any element added beyond this length from within the callback is not visited. Other changes to the array (setting the value of or deleting an element) may affect the results of the operation if the method visits the changed element afterwards. While the specific behavior of these methods in such cases is well-defined, you should not rely upon it so as not to confuse others who might read your code. If you must mutate the array, copy into a new array instead.</p>
-
-<dl>
- <dt>{{jsxref("Array.prototype.forEach()")}}</dt>
- <dd>Calls a function for each element in the array.</dd>
- <dt>{{jsxref("Array.prototype.entries()")}} {{experimental_inline}}</dt>
- <dd>Returns a new <code>Array Iterator</code> object that contains the key/value pairs for each index in the array.</dd>
- <dt>{{jsxref("Array.prototype.every()")}}</dt>
- <dd>Returns true if every element in this array satisfies the provided testing function.</dd>
- <dt>{{jsxref("Array.prototype.some()")}}</dt>
- <dd>Returns true if at least one element in this array satisfies the provided testing function.</dd>
- <dt>{{jsxref("Array.prototype.filter()")}}</dt>
- <dd>Creates a new array with all of the elements of this array for which the provided filtering function returns true.</dd>
- <dt>{{jsxref("Array.prototype.find()")}} {{experimental_inline}}</dt>
- <dd>Returns the found value in the array, if an element in the array satisfies the provided testing function or <code>undefined</code> if not found.</dd>
- <dt>{{jsxref("Array.prototype.findIndex()")}} {{experimental_inline}}</dt>
- <dd>Returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found.</dd>
- <dt>{{jsxref("Array.prototype.keys()")}} {{experimental_inline}}</dt>
- <dd>Returns a new <code>Array Iterator</code> that contains the keys for each index in the array.</dd>
- <dt>{{jsxref("Array.prototype.map()")}}</dt>
- <dd>Creates a new array with the results of calling a provided function on every element in this array.</dd>
- <dt>{{jsxref("Array.prototype.reduce()")}}</dt>
- <dd>Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value.</dd>
- <dt>{{jsxref("Array.prototype.reduceRight()")}}</dt>
- <dd>Apply a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a single value.</dd>
- <dt>{{jsxref("Array.prototype.values()")}} {{experimental_inline}}</dt>
- <dd>Returns a new <code>Array Iterator</code> object that contains the values for each index in the array.</dd>
- <dt>{{jsxref("Array.prototype.@@iterator()", "Array.prototype[@@iterator]()")}} {{experimental_inline}}</dt>
- <dd>Returns a new <code>Array Iterator</code> object that contains the values for each index in the array.</dd>
-</dl>
-
-<h3 id="Generic_methods" name="Generic_methods">Generic methods</h3>
-
-<p>Many methods on the JavaScript Array object are designed to be generally applied to all objects which “look like” Arrays. That is, they can be used on any object which has a <code>length</code> property, and which can usefully be accessed using numeric property names (as with <code>array[5]</code> indexing). <span class="comment">TODO: give examples with Array.prototype.forEach.call, and adding the method to an object like {{jsxref("Global_Objects/JavaArray", "JavaArray")}} or {{jsxref("Global_Objects/String", "String")}}.</span> Some methods, such as {{jsxref("Array.join", "join")}}, only read the <code>length</code> and numeric properties of the object they are called on. Others, like {{jsxref("Array.reverse", "reverse")}}, require that the object's numeric properties and <code>length</code> be mutable; these methods can therefore not be called on objects like {{jsxref("Global_Objects/String", "String")}}, which does not permit its <code>length</code> property or synthesized numeric properties to be set.</p>
-
-<h2 id="Specifications" name="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>ECMAScript 1st Edition.</td>
- <td>Standard</td>
- <td>Initial definition.</td>
- </tr>
- <tr>
- <td>{{SpecName('ES5.1', '#sec-15.4.3.1', 'Array.prototype')}}</td>
- <td>{{Spec2('ES5.1')}}</td>
- <td> </td>
- </tr>
- <tr>
- <td>{{SpecName('ES6', '#sec-array.prototype', 'Array.prototype')}}</td>
- <td>{{Spec2('ES6')}}</td>
- <td> </td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Browser_compatibility" name="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" name="See_also">See also</h2>
-
-<ul>
- <li>{{jsxref("Global_Objects/Array", "Array")}}</li>
- <li>{{jsxref("Function.prototype")}}</li>
-</ul>