predicate should be a function that accepts three arguments and returns a value that is coercible to a Boolean value.
findLast
calls predicate once for each element of the array, in descending order, until it finds one where predicate returns findLast
immediately returns that element value.
Otherwise, findLast
returns
If a thisArg parameter is provided, it will be used as the
predicate is called with three arguments: the value of the element, the index of the element, and the object being traversed.
findLast
does not directly mutate the object on which it is called but the object may be mutated by the calls to predicate.
The range of elements processed by findLast
is set before the first call to predicate.
Elements that are appended to the array after the call to findLast
begins will not be visited by predicate.
If existing elements of the array are changed, their value as passed to predicate will be the value at the time that findLast
visits them.
When the findLast
method is called, the following steps are taken:
The findLast
function is intentionally generic; it does not require that its
predicate should be a function that accepts three arguments and returns a value that is coercible to a Boolean value.
findLastIndex
calls predicate once for each element of the array, in descending order, until it finds one where predicate returns findLastIndex
immediately returns the index of that element value. Otherwise, findLastIndex
returns -1.
If a thisArg parameter is provided, it will be used as the
predicate is called with three arguments: the value of the element, the index of the element, and the object being traversed.
findLastIndex
does not directly mutate the object on which it is called but the object may be mutated by the calls to predicate.
The range of elements processed by findLastIndex
is set before the first call to predicate.
Elements that are appended to the array after the call to findLastIndex
begins will not be visited by predicate.
If existing elements of the array are changed, their value as passed to predicate will be the value at the time that findLastIndex
visits them.
When the findLastIndex
method is called, the following steps are taken:
The findLastIndex
function is intentionally generic; it does not require that its
The initial value of the @@unscopables
This property has the attributes { [[Writable]]:
The interpretation and use of the arguments of .prototype.findLast
are the same as for Array.prototype.findLast
as defined in
When the findLast
method is called, the following steps are taken:
This function is not generic. The
The interpretation and use of the arguments of .prototype.findLastIndex
are the same as for Array.prototype.findLastIndex
as defined in
When the findLastIndex
method is called, the following steps are taken:
This function is not generic. The
© 2022 Wenlu Wang, Daniel Rosenwasser
All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.