一个数组里面是字符串数组 怎么不转换类型来进行相加 ?
数字字符串转为number类型,在前面加个+号就行, `
var numArr=["1","2","3","4"]; var sum=0; numArr.forEach(d=>{ sum+=+d; }) console.log(sum) `
+'s1' + +'s2'