有没有一种方便的方法可以从这个数组中获取前 n 个索引:
var alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
并将其存储在另一个数组中,比如说alphabet2 = ['a','b','c'];
不必用循环蛮力?谢谢
有没有一种方便的方法可以从这个数组中获取前 n 个索引:
var alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
并将其存储在另一个数组中,比如说alphabet2 = ['a','b','c'];
不必用循环蛮力?谢谢