replace(/[^0-9]/ig,"")
效果:
for (var i =0; i < artboards1.length; i++) { // 数据伪造的 console.log(artboards1[i].namem, parseInt(artboards1[i].name.replace(/[^0-9]/ig,""))) }
结果如下: