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