const lastN = (arr, n) => arr.slice(-n)
lastN(['a', 'b', 'c', 'd'], 2) // ['c', 'd']
posted on 2022-09-07 09:44 小馬過河﹎ 阅读(70) 评论(0) 收藏 举报