DEV Community

Discussion on: Tips: How to get last element of an array in javascipt

Collapse
 
mrcaidev profile image
Yuwang Cai

I especially love this feature when combined with optional chain, in TypeScript, e.g. unknownArr?.at(1) ?? 0. It makes the code so much cleaner.

Some comments have been hidden by the post's author - find out more