const datas =[ "http://images/38f78c640...../images1_wh400&200.png", "http://images/38f78c640...../images2_wh400&200.png", "http://images/38f78c640...../images3_wh400&200.png",] 正则图片里的数字除以2,640/2,360/2,替换成 "http://images/38f78c640...../images1_wh200&100.png",地址里固定的就是图片名了,"images?_wh?&?.png"
1 回答
森栏
TA贡献1810条经验 获得超5个赞
datas.join(",").replace(/\d+/g,function(match){
return (+match)/2;
}).split(",");
添加回答
举报
0/150
提交
取消