Software dev at Netflix | DC techie | Conference speaker | egghead Instructor | TC39 Educators Committee | Girls Who Code Facilitator | Board game geek | @laurieontech on twitter
Software dev at Netflix | DC techie | Conference speaker | egghead Instructor | TC39 Educators Committee | Girls Who Code Facilitator | Board game geek | @laurieontech on twitter
Yes, you could loop through in reverse. The first non-element would return undefined.
Yes, if you have holes then you'll need to check relative to the length of your array.
sure or you should do as suggested here dev.to/hisuwh/comment/1fcp7
I still miss the value of
.at()
beside being a sugar syntax to get the last itemSadly you can't just check for an undefined element because array with "hole" like
const arr = [1,,3,4];
can create a problem with that logic.