DEV Community

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

Collapse
 
yxsh profile image
Yash

well i always do

array[array.length - 1]
Enter fullscreen mode Exit fullscreen mode

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