ts get last element in array code example
Example 1: find last element in array nodejs
var a = loc_array.slice(-1)[0]
Example 2: how to get last element of array in typescript
var items: String[] = ["tom", "jeff", "sam"];
alert(items[items.length-1])