Skip to content

Commit

Permalink
Adding relative indexing method (mdn#1525)
Browse files Browse the repository at this point in the history
* Adding relative indexing method

Adding at() method

* Making suggested amends

* Update index.html

Co-authored-by: Chris Mills <[email protected]>
  • Loading branch information
Rumyra and chrisdavidmills authored Jan 22, 2021
1 parent 8dd1e3f commit 7489738
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions files/en-us/mozilla/firefox/experimental_features/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,42 @@ <h3 id="Property_math-style">Property: math-style </h3>

<h2 id="JavaScript">JavaScript</h2>

<h3 id="Relative_indexing_method">Relative indexing method</h3>

<p>The relative indexing method <code>at()</code> has been added to the <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a></code>, <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></code> and <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray">TypedArray</a></code> global objects. Passing a positive integer to the method returns the item or character at that position, and it also accepts negative integers, which count back from the end of the array or string. For example, `1` would return the second item or character and `-1` would return the last item or character. See <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at">Array.prototype.at()</a></code>, <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/at">String.prototype.at()</a></code> and <code><a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/at">TypedArray.prototype.at()</a></code> for more details.</p>

<table class="standard-table" style="max-width: 42rem;">
<thead>
<tr>
<th scope="col" style="vertical-align: bottom;">Release channel</th>
<th scope="col" style="vertical-align: bottom;">Version added</th>
<th scope="col" style="vertical-align: bottom;">Enabled by default?</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Nightly</th>
<td>85</td>
<td>Yes</td>
</tr>
<tr>
<th scope="row">Developer Edition</th>
<td>85</td>
<td>No</td>
</tr>
<tr>
<th scope="row">Beta</th>
<td>85</td>
<td>No</td>
</tr>
<tr>
<th scope="row">Release</th>
<td>85</td>
<td>No</td>
</tr>
</tbody>
</table>

<h3 id="Private_class_fields">Private class fields</h3>

<p>See <a href="/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields">Private class fields</a> for more details.</p>
Expand Down

0 comments on commit 7489738

Please sign in to comment.