将字符串数组转换为数字数组
var arr = ['123','22'];
var result = arr.map((s) => {
return s.split("").map((x) => {
return x - 0;
}).reduce((x,y) => {
return x*10+y;
})
})
console.log(result)//[ 123, 22 ]
var arr = ['123','22'];
var result = arr.map((s) => {
return s.split("").map((x) => {
return x - 0;
}).reduce((x,y) => {
return x*10+y;
})
})
console.log(result)//[ 123, 22 ]