JS - 获取数组中的最后1个

arr = [1,2,3,4,5]

console.log(arr[arr.length-1])    //输出的为5,即最后一个

posted @ 2019-09-03 13:17  武卡卡  阅读(1685)  评论(0编辑  收藏  举报