So, before ES13 if you want to find the last element of an array or string.
You need to subtract 1 from the length of the array and string and the calculated value will be passed within  to get the last element like this 👇
But now, after ES13 you can use at() method with negative indexes to get the elements in reverse order of a string or array like this 👇
Thanks for reading this article.
If you find this post helpful