Stop using .reverse().find(): meet findLast()
If you’ve ever needed to search an array from the end, you’ve probably used .slice().reverse().find(...), or looped backward manually. It works, but it’s clunky. We now have a better way: Array.prototype.findLast() and Array.prototype.findLastIndex(). They search from the end without reversing anything. The problem with reversing arrays Working with lists in...