# Select last item array where key has a value over a certain number

**URL:** https://discourse.nodered.org/t/select-last-item-array-where-key-has-a-value-over-a-certain-number/76862
**Category:** General
**Created:** [23 March 2023 11:18 UTC](https://discourse.nodered.org/t/select-last-item-array-where-key-has-a-value-over-a-certain-number/76862 "2023-03-23T11:18:36Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [23 March 2023 11:38 UTC](https://discourse.nodered.org/t/select-last-item-array-where-key-has-a-value-over-a-certain-number/76862/2 "2023-03-23T11:38:39Z")

</div>

Have a look at my solution using `find()` in [your other post](https://discourse.nodered.org/t/set-payload-to-first-occurence-of-certain-key-value-in-array/76857) to find the _first_ matching element in an array. Make sure you understand how that works (ask there for help if you can't understand it after looking at the docs for `Array.find()`) and then have a go at solving this problem using `findLast()` which is exactly the same as `find()` except that it finds the last matching instead of the first.

---

_[View the full topic](https://discourse.nodered.org/t/select-last-item-array-where-key-has-a-value-over-a-certain-number/76862)._
