var value = '1,2,3,4,5,6,7,8,9'
输出[2, 5, 8]
输出索引匹配 i%3===1 的整形数组
1
cyd 2019-05-24 15:36:47 +08:00
value.split(",").filter((i,j)=>j%3===1)
|
2
bdbd001 2019-06-12 10:54:33 +08:00
value.split(",").map((i)=>i*1).filter((i)=>(i%3===2))
|