Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Update for advancement to stage 3 #47

Merged
merged 2 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Proposal for `.findLast()` and `.findLastIndex()` methods on array and typed array.

## Status
This proposal is a [stage 2 proposal](https://github.com/tc39/proposals#stage-2) and waiting for feedback.

This proposal is a [stage 3 proposal](https://github.com/tc39/proposals#stage-3) and seeking implementation feedback.

## Motivation

Expand Down Expand Up @@ -33,7 +34,7 @@ Therefore there is a third issue:

3. **complex index calculation**

So, perhaps we need something directly and effectily. In this proposal, they are `{Array, %TypedArray%}.prototype.findLast` and `{Array, %TypedArray%}.prototype.findLastIndex`.
So, perhaps we need something directly and effectively. In this proposal, they are `{Array, %TypedArray%}.prototype.findLast` and `{Array, %TypedArray%}.prototype.findLastIndex`.

## Scenarios
- You know find from last may have better performance (The target element on the tail of the array, could append with `push` or `concat` in a queue or stack, eg: recently matched time point in a timeline).
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2284,7 +2284,7 @@
.normative-optional-tag a {
color: #884400;
}
</style></head><body><div id="menu-toggle">☰</div><div id="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-array.prototype.findlast" title="Array.prototype.findLast ( predicate [ , thisArg ] )"><span class="secnum">1</span> Array.prototype.findLast ( <var>predicate</var> [ , <var>thisArg</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-array.prototype.findlastindex" title="Array.prototype.findLastIndex ( predicate [ , thisArg ] )"><span class="secnum">2</span> Array.prototype.findLastIndex ( <var>predicate</var> [ , <var>thisArg</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-array.prototype-@@unscopables" title="Array.prototype [ @@unscopables ]"><span class="secnum">3</span> Array.prototype [ @@unscopables ]</a></li><li><span class="item-toggle-none"></span><a href="#sec-%typedarray%.prototype.findlast" title="%TypedArray%.prototype.findLast ( predicate [ , thisArg ] )"><span class="secnum">4</span> %TypedArray%.prototype.findLast ( <var>predicate</var> [ , <var>thisArg</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-%typedarray%.prototype.findlastindex" title="%TypedArray%.prototype.findLastIndex ( predicate [ , thisArg ] )"><span class="secnum">5</span> %TypedArray%.prototype.findLastIndex ( <var>predicate</var> [ , <var>thisArg</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version first">Stage 2 Draft / July 5, 2021</h1><h1 class="title">Proposal-array-find-from-last</h1>
</style></head><body><div id="menu-toggle">☰</div><div id="menu-spacer"></div><div id="menu"><div id="menu-search"><input type="text" id="menu-search-box" placeholder="Search..."><div id="menu-search-results" class="inactive"></div></div><div id="menu-pins"><div class="menu-pane-header">Pins</div><ul id="menu-pins-list"></ul></div><div class="menu-pane-header">Table of Contents</div><div id="menu-toc"><ol class="toc"><li><span class="item-toggle-none"></span><a href="#sec-array.prototype.findlast" title="Array.prototype.findLast ( predicate [ , thisArg ] )"><span class="secnum">1</span> Array.prototype.findLast ( <var>predicate</var> [ , <var>thisArg</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-array.prototype.findlastindex" title="Array.prototype.findLastIndex ( predicate [ , thisArg ] )"><span class="secnum">2</span> Array.prototype.findLastIndex ( <var>predicate</var> [ , <var>thisArg</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-array.prototype-@@unscopables" title="Array.prototype [ @@unscopables ]"><span class="secnum">3</span> Array.prototype [ @@unscopables ]</a></li><li><span class="item-toggle-none"></span><a href="#sec-%typedarray%.prototype.findlast" title="%TypedArray%.prototype.findLast ( predicate [ , thisArg ] )"><span class="secnum">4</span> %TypedArray%.prototype.findLast ( <var>predicate</var> [ , <var>thisArg</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-%typedarray%.prototype.findlastindex" title="%TypedArray%.prototype.findLastIndex ( predicate [ , thisArg ] )"><span class="secnum">5</span> %TypedArray%.prototype.findLastIndex ( <var>predicate</var> [ , <var>thisArg</var> ] )</a></li><li><span class="item-toggle-none"></span><a href="#sec-copyright-and-software-license" title="Copyright &amp; Software License"><span class="secnum">A</span> Copyright &amp; Software License</a></li></ol></div></div><div id="spec-container"><h1 class="version first">Stage 2 Draft / July 14, 2021</h1><h1 class="title">Proposal-array-find-from-last</h1>

<emu-clause id="sec-array.prototype.findlast">
<h1><span class="secnum">1</span> Array.prototype.findLast ( <var>predicate</var> [ , <var>thisArg</var> ] )</h1>
Expand Down