js 字符串数组转为整形int类型数组
https://blog.csdn.net/weixin_43285861/article/details/123392784
let dataStr="1,2,3,4,5"; //原始字符串 let dataStrArr=dataStr.split(","); //分割成字符串数组 let dataIntArr=[];//保存转换后的整型字符串 //方法一 dataStrArr.forEach(item => { dataIntArr.push(+item); }); console.log(dataIntArr);