Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

findLastIndex is not a function,how,why

const list = [1,2,100,50,100,20]
const index = list.findLastIndex((item)=>item===100)
console.log(index)
// TypeError: list.findLastIndex is not a function

Can we say that this method does not exist, but it does exist in MDN

like image 933
Shylock Wu Avatar asked Feb 24 '26 01:02

Shylock Wu


1 Answers

if you look at compatibility info on MDN

it is not supported below node 18.

check your node version

    node -v

Or

    node --version
like image 92
ashish singh Avatar answered Feb 26 '26 13:02

ashish singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!